function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nikhil Shah 14Nikhil Shah 14 

Refresh LWC when related list is updated

Hi,

In LWC, there is a way to automatically update the content in it when the record is updated without having to refresh the page. This is possible if we use getRecordNotifyChange.

My question is how do we detect a change in the related list in a custom LWC? For example, when I delete a file from the Files related list, I see the spinner appear on each of the standard related lists meaning that they are getting automatically refreshed when I delete the related file. So, how do I get a custom LWC also to refresh itself when a related record or atleast a related file is deleted?
ravi soniravi soni
Hi Nikhil,
I think you want that if you update/delete or make any changes in database(Record) then your lwc page automatically refresh.
so for achieve this requirment you need to use trigger,platform event and LMS. by the help of these you can achieve this requirment.
I am sharing a blog with you that might be helpfull to you.
https://sfdcfamily.blogspot.com/2021/08/lightning-datatable-with-autorefresh.html

don't forget to mark it as the best answer if it's helpfull to you.

Thanks
ravi soniravi soni
hi nikhil,
please mark it as the best mark if it's helpful to you so that it can help to others.
Thanks