UI policy and Client Script which works

armanoj
Mega Sage

Hi ,

 

Client script to make a field Mandatory.

Same Created for the UI policy to make field Mandatory.

 

What will be the outcome of this question?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@armanoj 

UI policy runs after client script

Now in your question it won't impact as you are making it mandatory at both the places.

But if you are doing something on the same field in UI policy it takes the preference as it runs the last

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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

View solution in original post

3 REPLIES 3

Dr Atul G- LNG
Tera Patron

Hi @armanoj 

 

My knowledge say UI Policy first run.

*************************************************************************************************************
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/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron

@armanoj 

UI policy runs after client script

Now in your question it won't impact as you are making it mandatory at both the places.

But if you are doing something on the same field in UI policy it takes the preference as it runs the last

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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

Ravi Chandra_K
Kilo Patron

Hello @armanoj 

Client script runs first which makes field mandatory. If UI policy makes on the same field makes it non mandatory, then your field will be non mandatory.

 

adding this detailed article here 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