Can multiple onsubmit client script of same order run parallelly or will it run randomly/serquentially?

Shariq Azim
Kilo Guru

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

1 ACCEPTED SOLUTION

MrMuhammad
Giga Sage

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. 

Regards,
Muhammad

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I believe the order cannot be determined

Regards
Ankur

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

so you are saying that order plays no role in onsubmit  client script execution?

Hi,

As mentioned by Muhammad give order from lower to higher and they will run in sequence

Regards
Ankur

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

MrMuhammad
Giga Sage

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. 

Regards,
Muhammad