@api recordId is not loading immediately in LWC used in QuickAction when
- Initially clicked on quick action => recordId - works Fine
- Updated record without reloading the page (which is done by another LWC in record Page)
- Again clicked on quick action => recordId - Will not load for immediate click so need to get from url
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