You need to sign in to do that
Don't have an account?
Nikhil 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?
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?
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
please mark it as the best mark if it's helpful to you so that it can help to others.
Thanks