How club the onchange clients having same logic for different set of fields.

Aditya253
Kilo Guru

Hi Team,

 

I had a requirement like in one of the tab I had 3 sets of fields for each set there are six fields by using these 6 fields I need to make calculations, I achieved that by using onchange clients. What I did is for each set I wrote 7 client scripts to I achieve the requirements, I thought those different fields sets but having same logic that's why I wrote like that, if any another approach is there for clubbing all scripts in one please let me know.

 

Thanks & Regards,

Aditya .

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@Aditya253 You can choose to create a UI Script instead and keep all the logic reside in it. Call this UI Script inside your client script, this way your core logic would be centralised and in case of any change you wouldn't have to make changes in all those 7 client script.

 

Please refer to this URL https://docs.servicenow.com/bundle/washingtondc-application-development/page/script/client-scripts/c... to know more about UI Script.