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
Parantap SrivastavParantap Srivastav 

Need to link a button in a modal to reload a datatable in the vf page.

I have a visualforce page that shows my tasks subject as a datatable column. I  have a link  - 

<a class="editIcon" href="/{!task.Id}/e?&tsk12=Completed" style="float:right;">
    <img src="{!URLFOR($Resource.Images, '/Edit40.png')}" style="width: 18px;       margin-left: 6px;margin-top:-2x"/>
 </a>

next to the subject on every row which opens up the standard task (detail) page as a modal. Now after I complete editing my task and click save button, I get my vf page back but the task changes are not reflected in the table, They are visible only after I reload the table. How do I reload my table on clicking the save button in the modal? Images are attached.This is the datable with Task Name as the task subject and pencil icon as the link to the detail page modal.This is the edit page that opens up on the click of the pencil icon(link). I want to reload my datatable by clicking the save button on this modal.
Khan AnasKhan Anas (Salesforce Developers) 
Hi Parantap,

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.

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