Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 11:23 PM
Hi All,
Which client script will run first- onCellEdit or onChange/onSubmit/onLoad client script if the script has been written on the same field?
This question was asked in an interview. Can anyone can tell me?
Thanks,
Rooma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 11:45 PM
please check the below link
Kindly mark helpful/accepted if it helps you.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 12:05 AM
Hi @Rooma1
Please note that OnCellEdit() executes on list view only.
The execution order of client scripts on form are as follows -
1. onLoad()- When the form is loaded.
2. onChange()- When any change on the form is made.
3. onSubmit()- When a form is saved or submitted.
Please mark my answer helpful and correct.
Regards,
Amit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 01:07 AM
Hi @Rooma1
The three types of client scripts, onLoad, onChange, onSubmit runs on the forms, that is loading,change and submission on forms sequentially.
onCellEdit only works in the list layout.
Whenever the form loads onLoad executes first, then onCHange, and once the form is submiited then the onSubmit.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 01:14 AM
Hi @Rooma1
Oncell edit for List view.
onchange --> if you are changing any value on form level
onsubmit --> when you submit the record.
onload -- as soon form get loaded.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************