- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 01:49 AM
Hi Team,
First of all, Please note that I am trying to understand how servicenow works and NOT asking for a workaround i.e. merging 2 of the script or adding a order.
I have a peculiar case where for some reasons two onsubmit client scripts on service catalog item were written of blank/zero order field value.
One of them simply populates some field A on submission another will populate field B & will also restrict submission on a condition. And for some reasons field B is not populated after submission. This however is a only one case of randomness, every other time it worked great.
Now i think since one of the two onsubmit script allowed to submit without returning false, it simply bypasses the other one and continued to submit .And thus, did not populate the value on field B.
Or will it run both the client script in any random order and should it also populate field b after/before running the other script?
Regards,
Shariq
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 01:56 AM
With blank/zero order it would execute randomly. However, if you will give an order then it can be executed sequentially. Lower to higher order in sequence.
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 01:54 AM
Hi,
I believe the order cannot be determined
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 06:56 AM
so you are saying that order plays no role in onsubmit client script execution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 07:02 AM
Hi,
As mentioned by Muhammad give order from lower to higher and they will run in sequence
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 01:56 AM
With blank/zero order it would execute randomly. However, if you will give an order then it can be executed sequentially. Lower to higher order in sequence.
Muhammad