Is it possible to make Form auto-refresh when other user updated the value of Related List record?

Aki18
Tera Contributor

When I'm on the particular table form, looks like the change of the value in it's Related List made by other user is not reflected unless I refresh the browser.

Is there any way to make Form auto-refresh when other user updated the value of Related List record?

 

Best Regards,

Aki

1 ACCEPTED SOLUTION

Yes , client script will run for only person who is updating.

But if you are thinking to have something similar at server side to work when updating person is different and viewer is different then I believe forcing page refresh on specific interval can work but it was a very big impact in terms of loss of unsaved information.

Scenario: imagine you set auto refresh form in every 5 seconds.

Now if some one is creating incident and filling out form data and in the middle of that page refreshes after 5 seconds then all the data entered into fields will be gone.

So its not helpful.

keeping all the possibilities in mind, i might have pushed back to requester of this requirement with all these facts.

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

View solution in original post

5 REPLIES 5

Ratnakar7
Mega Sage
Mega Sage

Hi @Aki18 ,

 

You can use the setTimeout() or setInterval() functions in JavaScript to trigger a refresh of the form page after a specified time interval. For example, you can use the following code snippet in a client-side script to refresh the form page every 5 seconds:

 

setTimeout(function() {
  location.reload();
}, 5000);

 

 

This will reload the form page every 5 seconds, which will reflect any updates made by other users in the related list.

 

If my response was helpful in resolving the issue, please consider accepting it as a solution by clicking on the Accept solution button and giving it a thumbs up 👍. This will benefit others who may have a similar question in the future.

 

Thank you!

Ratnakar

Aki18
Tera Contributor

Hi @Ratnakar7 ,

Thank you for your reply, but could you tell me where I should write that script?

sushantmalsure
Mega Sage
Mega Sage

hello @Aki18 

Something similar is achieved by using onCellEdit client script

https://www.servicenow.com/community/developer-forum/reload-form-when-update-record/m-p/1364878

you just have to adjust your table and see it automatically reloading the form

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Hi @sushantmalsure ,

Thank you for your information! I tried that way, but looks like the OnCellEdit Client Script reloads the form only for the updated person. What I would like to do is to update "my" form when "other user" updated the cell value of the Related List record in current form.

Do you have any solutions for this requirement?