Skip to main content

@api recordId is not loading immediately in LWC used in QuickAction when 

 

  1. Initially clicked on quick action => recordId - works Fine 
  2. Updated record without reloading the page (which is done by another LWC in record Page)
  3. Again clicked on quick action => recordId - Will not load for immediate click so need to get from url 

 

#LWC  #LWC Development

1 comentário
  1. 9 de out. de 2024, 09:30

    If you're updating records via another LWC and need to refresh data in the Quick Action component, consider using refreshApex to re-fetch the record information.

    RefreshApex is useful for ensuring that your Lightning Web Component (LWC) reflects the most current data, especially after a record update. It is a utility that allows you to refresh data fetched using @wire. It updates the record information without requiring a full page reload.

     

    Ensure that the data you retrieve is done using the @wire decorator; this is necessary for refreshApex to function properly.

     

    For detailed info on refreshApex , you can go through :

    https://developer.salesforce.com/docs/platform/lwc/guide/apex-result-caching.html

0/9000