UI policy VS client script .

tghadage124
Tera Contributor

which one will run first : 

 

client script or UI policy ?
it depends on the type of client script and option selected in UI policy. 

 

if on change then what will happen if UI policy (on load checked or unchecked then what will happen ) or client script will run first ?

on load  then what will happen if UI policy ( on load checked or unchecked then what will happen  ) or client script will run first ?

on submit then what will happen if UI policy ( on load checked or unchecked then what will happen ) or client script will run first ? 

 

can anyone please Ans me this in details please its very IMP interview question ? 

 

thanks !!

 

1 ACCEPTED SOLUTION

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @tghadage124 

Client Script will run first, then it's UI policy.

even If on load is checked on UI policy, on load client script will run first, then it's UI policy.

 

Please refer the below article which clearly explains various scenarios:

https://www.servicenow.com/community/developer-blog/a-race-between-ui-policy-and-client-script/ba-p/...

 

 

Please mark the answer as helpful and correct if helped.

Kind regards,

Ravi Chandra 

View solution in original post

1 REPLY 1

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @tghadage124 

Client Script will run first, then it's UI policy.

even If on load is checked on UI policy, on load client script will run first, then it's UI policy.

 

Please refer the below article which clearly explains various scenarios:

https://www.servicenow.com/community/developer-blog/a-race-between-ui-policy-and-client-script/ba-p/...

 

 

Please mark the answer as helpful and correct if helped.

Kind regards,

Ravi Chandra