When writing an Aura Lightning Component you can use the following to update data for standard components as detailed on this page:


$A.get('e.force:refreshView').fire();

Unfortunately, with Lightning Web Components you cannot run the above code as is. Fortunately, you can easily modify the above to make it work in an LWC. All you have to do is leverage eval():


eval('$A').get('e.force:refreshView').fire();

Hopefully this quick snippet works for you. Happy coding! 😎

Categories: BlogJavaScriptSalesforce

Leave a Reply

Your email address will not be published. Required fields are marked *