How to avoid live form feature triggering th onchange client script on another user screen


Description

Symptoms

Consider a scenario where User 1 views an incident record in his browser window and at the same time User 2 is also viewing the same incident record in his separate browser window.

Let's consider that "live form" feature is enabled and there is a onchange client script on priority field which has a alert().

With this scenario, when User 1 changes the priority of the incident record, User 2 gets the onchange client script (on the priority field) gets executed on his screen and the alert() window shows up.

Release

Any supported release. 

Cause

Due to the live form feature when the original user was modifying the record which was viewed by another user, he/she gets the priority changed in his form as well, this triggers the onchange event for priority field eventually onchange client script is invoked.

Resolution

You can workaround the situation via using the g_form.isLiveUpdating() API and decide the execution of client-side script accordingly.

Additional Information

isLiveUpdating

Client scripts