- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 03:05 PM
Hi, I have an onLoad client script that triggers when an Incident record is opened and this script triggers a script include and based on few calculations I need to set a value on the Incident form.
The value is being set but not saved in the data base, Is there a way to save the value using the client script withoutt reloading the same incident page?
I used g_form.save() but this process will be an Infinite loop as I will be loading and updating the same Incident record.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 03:41 PM
Well, that remote table certainly presents something of a challenge.
One potential (if somewhat heavy-handed) solution would be to perform your check onload as you are now, but instead of updating the g_form and saving, you could write a GlideAjax script that you can call, pass in the sys_id of your incident and the field value you want to set. Then, server-side, you can run a GlideRecord call, get the record, set the field and update the record server-side.
The effect would be similar to what happens when you have a record open and someone else opens it and updates it - if the field is visible on the form, they will see the "heart-beat" icon and the new value.
At least with this approach you only perform the check once or each form load, and you save the result server-side avoiding the reload-loop.
Might take some tinkering but seems like a workable approach.
I hope this helps!
If this was helpful, or correct, please be kind and mark the answer appropriately.
Michael Jones - Proud member of the GlideFast Consulting Team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 03:13 PM
Could you provide a little detail as to exactly what your use-case is here? Is this an update you only want to occur once in the life of an incident, or something you want to update every time the incident is loaded on the platform? In short, any changes you make client-side will not be committed until you save the record, and on each save or update the form will reload.
Depending on what you are trying to accomplish there may be an alternate method you can explore.
I hope this helps!
If this was helpful, or correct, please be kind and mark the answer appropriately.
Michael Jones - Proud member of the GlideFast Consulting Team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 03:31 PM
Here is my use case --- There is a related list on the incident and I need to query the table on load of the incident record and check if there are any records that are in progress and mark a field on the Incident as Active.
As the related list table is a remote table - I can NOT write a business rule on the related list table. Please suggest if there are any other solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 03:41 PM
Well, that remote table certainly presents something of a challenge.
One potential (if somewhat heavy-handed) solution would be to perform your check onload as you are now, but instead of updating the g_form and saving, you could write a GlideAjax script that you can call, pass in the sys_id of your incident and the field value you want to set. Then, server-side, you can run a GlideRecord call, get the record, set the field and update the record server-side.
The effect would be similar to what happens when you have a record open and someone else opens it and updates it - if the field is visible on the form, they will see the "heart-beat" icon and the new value.
At least with this approach you only perform the check once or each form load, and you save the result server-side avoiding the reload-loop.
Might take some tinkering but seems like a workable approach.
I hope this helps!
If this was helpful, or correct, please be kind and mark the answer appropriately.
Michael Jones - Proud member of the GlideFast Consulting Team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 05:18 PM
I was thinking the same but as the update is also on the Incident, I hope that script will not run in a loop. This is something I haven't tried yet. Thanks for the prompt response, I will get back with the update.