Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Which executes first ,UI policy action or UI policy script?

Rohith16
Tera Contributor

When runnning ui policies ,which executes first ,whether UI policy action or UI policy script?

27 REPLIES 27

Thanks, thats what I observe too. As it rollback actions if it false.

Ankur Bawiskar
Tera Patron

Hi Rohith,

UI policy has UI policy actions and also script when condition evaluates to true/false

so this is the order; try once

1) UI policy action first

2) UI policy script

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

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

Can you give me any idea ,how to test which executes first?

 

Hi Rohith,

Sample example:

1) on incident form write UI policy when state changes to closed; make short description as mandatory from UI policy action

2) from UI policy script execute if true; use below script

g_form.setMandatory('short_description', false);

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

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

We got two differents answer. Which one is the right answer please?