• Navin Ganeshan 10
  • NEWBIE
  • 20 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
Hi,

Hoping get some pointers on lightning-tree-grid from this group. in my LWC comp. i am displaying all roles in lwc tree grid with 2 additional cols as Read,  Write (as type button) 

What I am trying to achieve is, when a button is clicked for Read, set rows "Read" attribute as true and change button's icon to "action:approval". However, when I set the value for the row field, tree-grid does not refresh with the new icon.

Sample data: 
[
   {
      "roleId":"XXXX1",
      "name":"Global",
      "parentRoleId":null,
      "canRead":false,
      "canWrite":false,
      "iconName":"action:new",
      "_children":[
         {
            "roleId":"XXXX2",
            "name":"Global Child 1",
            "parentRoleId":"XXXX1",
            "canRead":false,
            "canWrite":false,
            "iconName":"action:new"
         },
         {
            "roleId":"XXXX3",
            "name":"Global Child 2",
            "parentRoleId":"XXXX1",
            "canRead":false,
            "canWrite":false,
            "iconName":"action:new"
         }
      ]
   }
]
rowAction:
handleRowAction(event) {
  const row = event.detail;
  row.canRead = true;
  row.iconName = "action:approval"
}
I would like to update the button icon, as soon as it clicked. Once user has selected as many rows as they would like, they would finally click on "Save" button to save the data. 

Question is, how to rerender the tree grid, to show the new icon. Please let me know if I could clarify the question further.

Thanks,
Navin

 
Hi,

Looking from some guidance on how to pre-populate account id on a custom aura component to create contacts. 

I would like to pre-populate account id on the component, when a user clicks on "New Contact", on Account's related contact list. I have declared "force:hasRecordId on the component. but nothing is returned for recordId:
 
<aura:component implements="force:lightningQuickAction,force:hasRecordId">  
     <lightning:input value={!v.recordId}
</aura:component>
However, this does work when i add new contact button to Account's record detail page. 

Any idea why this would not work from related page?

Thanks,
Navin
 
All,

I am new LWC and documentations have been immensly useful to get me started on this journey. However, while looking at various examples on getting data from objects, i see examples randomly using @wire at someplace and connectedCallback at others. 

question for this group is:
  • what is the basic difference between these 2
  • which situation would call for choosing between these 2 methods
  • @wire does not fire sometime (i mean no calls to the apex method at all)
Thanks,
Navin
Hi, 

I am creating a class that would call a rest API for some data, store in a custom object and display as a related lists in a case. However, need to figure out when the API call would be made. 

One of the solutions I thought was to create a lightning web component and embed that into case's record screen. When user opens the case and lwc loads, call the API to refersh the data. 

However, i am new to lwc, so thinking in terms of time to market. Question for this group, is it possible to call the API when a user clicks on the case id and case's record screen opens. if yes, then how should that be implmented. 

I dont have any code to share, as this is very much in my head for now!

Thanks,
Navin
 
Hi,

Looking from some guidance on how to pre-populate account id on a custom aura component to create contacts. 

I would like to pre-populate account id on the component, when a user clicks on "New Contact", on Account's related contact list. I have declared "force:hasRecordId on the component. but nothing is returned for recordId:
 
<aura:component implements="force:lightningQuickAction,force:hasRecordId">  
     <lightning:input value={!v.recordId}
</aura:component>
However, this does work when i add new contact button to Account's record detail page. 

Any idea why this would not work from related page?

Thanks,
Navin