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
Sunil_SFSunil_SF 

How to re-render custom component with the latest field value

Is there a way to re-render custom component with the latest field value ?

I.e For e.g User1 is viewing a record 'Account1' , whereas another user 'User2' is editing a field in the same reord Account1.. for User 1 , the field value should be updated without refreshing the  page..i.e rerndering the field with lastest value
Suraj GharatSuraj Gharat
Hi Sunil,

Without manual refreshing!!!

May be you could use ActionPoller to periodically check whether this account is updated or not, and based on that you would need to refresh or rerender your page.
Sunil_SFSunil_SF
Hi Suraj!

Yeah Without manual refreshing !

How would check if a account is updated or not ?
Suraj GharatSuraj Gharat
To check if it is updated or not, you may just query its "LastModifiedDate" field and compare it with your loaded "LastModifiedDate" value.
William TranWilliam Tran
Sunil,

This is a web application. it is typical that if user want the latest data they should refresh them via refreshing the browser.  
If you attempt to autorefresh, if not done properly, you could cause more harm than benefits by slowing down the system.

Also you would only do this if user is in view mode, if they are in edit mode, refreshing will wipe out their session/changes.

thx.