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
Sonal Gawde 2Sonal Gawde 2 

Lightening detail section fields are not getting refreshed when we delete related record from related tab

Hi,
I have create one custon object XYZ. It is having lookup of standard contact object. I have added XYZ related list on contact object page layout. User will add or delet the record from related list. If user deleted XYZ object record from contact related list, I am updating deleted date on contact object using trigger. But when record is deleted, detail page is not getting refreshed. I have to refresh the page manually to see the result.

I am using ligtening stardard pages only. Why detail section fields are not getting refreshed when we delete related record from related tab ? Is it salesforce issue ?
Naveen KNNaveen KN
Trigger will not refresh the data of the parent record page, we have to go with manual refresh
check the implementation here https://developer.salesforce.com/forums/?id=9060G0000005Vm7QAE

 
Suraj Tripathi 47Suraj Tripathi 47
Hi Sonal,
Greeting!

To refresh lightning page after deleting the record you can use<--- $A.get('e.force:refreshView').fire;----> inside your javascript function which you are calling after deleting the record. It will refresh your page when your record gets deleted.

If you find your solution mark this as best answer.

Thank you!
Regards,
Suraj Tripathi