- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 07:06 AM
Hi All,
I have a Client Script- OnChange which should prevent the users when they try to select the Approved status on the Change task form from the Status field. The script is working fine and showing an error message as expected when they select the Approved value from the Status field. But the problem I am facing is when the task is approved by the user from the Approvers tab that time also I am seeing the same error message as the script is written on OnChange.
Is there a way to prevent the Client Script firing when the task is approved from the Approvers tab?
Any help is really appreciated!!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2020 12:48 PM
Hi Siva,
This issue occurs when we approve an item from approver's related list and status of the item changes to "Approved" without form refresh. This is called live updating and we need to make sure that your script does not run when there is a live update on the field you have written your onChange client script on.
You need to add an if condition in your client script something like below and it should work.
if(!g_form.isLiveUpdating()){
////your code
}
Please mark my answer correct if it works.
Regards,
Rajnish Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2020 12:48 PM
Hi Siva,
This issue occurs when we approve an item from approver's related list and status of the item changes to "Approved" without form refresh. This is called live updating and we need to make sure that your script does not run when there is a live update on the field you have written your onChange client script on.
You need to add an if condition in your client script something like below and it should work.
if(!g_form.isLiveUpdating()){
////your code
}
Please mark my answer correct if it works.
Regards,
Rajnish Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2020 03:50 AM
Hi RKumar,
Thank you so much for your help. Adding g_form.isLiveUpdating()) to the if section of the client script preventing the Client Script firing when the field is updated by system.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '' || oldValue == newValue || g_form.isLiveUpdating()) {
return;
}
Thanks
Siva