how many types of client script in servicenow

mshiraz826
Mega Explorer

Hi Family,

 

Can anyone tell me how many types of client script in ServiceNow 

 

Many Thanks,

Abel Tuter,

8 REPLIES 8

Aditya_hublikar
Giga Sage

Hello @mshiraz826 ,

 

In servicenow there 4 types of client script as follow :

Aditya_hublikar_0-1781696860387.png

 

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya

Hello @mshiraz826 ,

 

You can also refer this thread for better understanding :

https://www.servicenow.com/community/developer-articles/client-script/ta-p/2827916

 

 

Ankur Bawiskar
Tera Patron

@mshiraz826 

this is an easy question and answer to this is easily available in docs.

Are you stuck somewhere or some specific question/doubt you have?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

yashkamde
Mega Sage

Hello @mshiraz826 ,

 

Below are the Types of client script with detailed explanation :

 

Client Script TypeWhen It RunsPurpose
onLoadExecutes when the form is loaded/openedUsed to initialize the form, set default values, hide/show fields, make fields mandatory or read-only, and display messages.
onChangeExecutes whenever the value of a specified field changesUsed to validate input, populate fields automatically, show/hide fields, and implement dynamic form behavior based on field values.
onSubmitExecutes when the user submits, saves, updates, or orders the formUsed to validate data before submission and prevent form submission if required conditions are not met.
onCellEditExecutes when a field is edited directly in a list viewUsed to validate or control inline list edits before the change is saved.

 

Also If you want examples for each let me know !

If my response helped mark as helpful and accept the solution.