The CreatorCon Call for Content is officially open! Get started here.

Sequence of execution of Client Scripts

Community Alums
Not applicable

Hi,

What would be the sequence of execution of Client Scripts? Kindly help.

Regards

Suman P.

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

You can easily find the answer to this in docs or community or youtube video

Did you try searching there first before posting to community?

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

Runjay Patel
Giga Sage

Hi @Community Alums ,

The execution order of Client Scripts is based on the type of event and script type.
see below execution order

  • onLoad: This script runs when the form is first loaded in the browser.
  • onChange: This script runs when a field's value changes. It triggers after a user interacts with a field and modifies its value.
  • onSubmit: This script runs when the form is being submitted, just before the data is sent to the server.
  • onCellEdit: This script runs when a cell in a list is edited (not applicable to forms, just lists).

 

Accept and mark helpful if my response helped you.