why client script gets executed first than UI Policy?

mallikharjunasw
Tera Contributor

why client script gets executed first than UI Policy?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Mallikharjuna,

That is how ServiceNow has defined it to work. Client scripts are executed first when form load because ServiceNow doesn't use any order for their execution.

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

6 REPLIES 6

Hello Ankur Bawiskar,

Thank you for your answer.

I have a doubt related to this question.

For OnLoad client script and UI Policies, OnLoad client script will be executed first.

But what about OnSubmit client script? If we compare OnSubmit client script and UI policies, which will be executed first ?

With warm regards,

Rishikesh 

Hi,

onSubmit always run when form is getting submitted/saved.

UI policies run when something changes

So ideally there cannot be direct comparision

Regards
Ankur

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