Why would an (onchange) client script pop-up run multiple times upon 'Save/Update' of record?

coreyo
Giga Contributor

I have an 'onChange' on the priority field, client script.  When the priority is changed (record not yet saved) pops up as expected.  When the user goes to 'Save / Update' the record, the pop up fires multiple times.  This is not an onSubmit, so not understanding why?  script below.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (oldValue != newValue) {
   //Popup asking user to validate the priority change
	   if(!g_form.isNewRecord()){
	   alert('You are changing the priority from ' + 'P' + oldValue + ' to ' + 'P' + newValue + '.  Please indicate in additional comments why the priority was changed and who approved.');
   }
}
}
1 ACCEPTED SOLUTION

That script works perfectly fine in my dev instance. Only fires on Priority change, never onLoad, or onSubmit. Are you sure the Priority change is being written to the dbase and something else isn't going on?

View solution in original post

16 REPLIES 16

That script works perfectly fine in my dev instance. Only fires on Priority change, never onLoad, or onSubmit. Are you sure the Priority change is being written to the dbase and something else isn't going on?

Thank you for your review on this.  It is obviously something internal causing this duplication.