You need to sign in to do that
Don't have an account?
![Lakshmi S Lakshmi S](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Unable to see the inserted record without refreshing the detail page of a Salesforce Custom object related list in Lightning.
Hi Team,
We are overriding Standard detail page using visualforce page in that we are added related lists " Open Activities" and "Activity History". In Lightning after adding Event or Task the detail page is not refreshed and newly added Event or Task not visible in the detail page.
Please let me know how can we resolve this issue.
Thanks in Advance.
Regards,
Lakshmi S.
We are overriding Standard detail page using visualforce page in that we are added related lists " Open Activities" and "Activity History". In Lightning after adding Event or Task the detail page is not refreshed and newly added Event or Task not visible in the detail page.
Please let me know how can we resolve this issue.
Thanks in Advance.
Regards,
Lakshmi S.
Greetings to you!
Currently, there is a known issue in lightning that prevents reflection of data updates on UI.
https://success.salesforce.com/issues_view?id=a1p3A0000001C8QQAU&title=data-not-updated-in-ui-after-an-apex-update-in-lightning-experience
Workaround by SF:
Updates made to Lightning Experience and Salesforce app components may occasionally not be reflected in the UI. Updates initiated by a different user or a different channel (API, Apex Trigger, etc) require an additional mechanism in order to update the UI.
The recommended solution is to refactor the component to use Lightning Data Service (force:recordData). Lightning Data Service provides a performance increase and eliminates out-of-sync issues. If you can’t refactor your component to use Lightning Data Service, you can also use force:refreshView to request a page refresh.
You can use force:refreshView to force all data to reload. Try like this:
And don't forget to add below handler in your component:
Also, please make sure to turn off browser caching in your Org.
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thanks for your reply.
How can we use above code in visualforce detail page, we need to create any lightning components ?
Please advise.
Thanks in Advance.
Regards
Lakshmi S