addOption for a variable triggers the related client script

ShAn21
Tera Guru

Hi Team,

Recently noticed something weird. I have a onchange script on state field when it changes to WIP. Later on based on certain variable conditions, I have to add an additional choice. Its works fine. But when the task state in wip and the option gets added, the onchange script that runs on wip state gets executed. Seems weird as nothing is changed. 

 

Have anyone has noticed this? If yes do you have any workaround for the same?

Related article: https://www.servicenow.com/community/developer-forum/g-form-addoption-triggering-onchange-client-scr...

 

Thanks

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

It would be helpful to see both/all scripts in there entirety - using the insert code icon </>