Client script way to stop onChange while form is being loaded

georgechen
Kilo Guru

Hi folks,

I am having a client script onChange vs onLoad question this time.         My colleague is having two onChange scripts and one onLoad script.   The onLoad script works perfectly, however when it populates a file that has one of the two onChange scripts , the onChange interferes with the form loading.

For example, while the form is being loaded, it populates the fields on the form in a record producer, but when it populates a field (say applicant name) which causes ripple affect to fire the onChange event.   Potentially there is a conflict on the onLoad and onChange as they both try to populate the form.

Script / Order / type

Script 1 100   onLoad

Script 2 200 onChange

Script 3 300 onChange

My questions here are

1) Is there a way to check if onLoad is completed

2) It is an form script synchronization issue, can the onChange script be temporarily disabled while form is being loaded?

Any advice would be appreciated.

Thanks,

1 ACCEPTED SOLUTION

Abhinandan Pati
Giga Guru

Hi George,



You can use 'isLoading' variable in your onChange Client script. If this boolean variable returns true then just return from the script.



Thanks,


Abhinandan


View solution in original post

2 REPLIES 2

Abhinandan Pati
Giga Guru

Hi George,



You can use 'isLoading' variable in your onChange Client script. If this boolean variable returns true then just return from the script.



Thanks,


Abhinandan


Hi Abhinandan


Thanks for your tip!     My colleague found an issue in the onLoad script and he has used the isLoading in the onChange script.     This issue has been resolved now.



Your attention and advice is much appreciated.


Thanks,