7

I have a custom LWC on a record detail page. This LWC displays files related to the record. I cannot use the standard Files related list because I only want to show files of type jpg, jpeg and png.

To mimic the standard Files related list, in my custom LWC when I click an image I'm calling the NavigationMixin with 'standard__namedPage' and 'filePreview'. This will open the image preview just like how it would on a standard Files related list. It also shows options like 'Edit File Details' and 'Delete File'.

The issue is when I click on Delete File, it does successfully delete the file but my LWC is not updated. Only when I manually refresh the browser, does the image disappear from my LWC. But I noticed that whenever I delete the file, all other standard related lists are getting automatically refreshed because I see the loading spinner on each of them.

This means that there is something that is telling those related lists that a file associated with their parent record was deleted. I want even my custom LWC to receive that "standard message?" so that I can re-render my LWC.

1 Answer 1

1

If you loaded the files using @wire, you could use refresh apex functionality to refresh the list every time you delete the file.

You must log in to answer this question.