ServiceNow Learning 59: Which runs first UI Policy Actions OR UI Policy Script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 01:01 AM
Hi All,
Today, I came across this interesting question that If I want something to happen at client side after running the Client Script and UI Policy Action.
So here I got to know this:
UI Policy Action triggers first and then at the end UI Policy Script runs at the end.
So If you want to perform any operation which should occur at the end of running all the script then write it in UI Policy Script.
Example:
I set the assigned to mandatory via UI Policy Action and did the opposite i.e. assigned to non-mandatory in UI Policy Script. Guess what happened.
When I reloaded the page, it made assigned to non-mandatory as UI Policy script at the end.
Hope it helps.
I hope this article helpful. Please mark it as helpful and bookmark if you like it.
Regards,
Shamma
- 1,114 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 03:40 AM
UI Policy action executes before the UI policy script.
We can test it by creating UI policy on the form for a particular field, e.g. category on incident form. In that, write UI policy script and create one UI Policy action. Then, go to Preferences->Developers->Click on JS Log and Field watcher, make it true. Then, you can Field Watch the category on incident form. You will see the execution order clearly in Field Watcher.
We can refer to the screenshot attached herewith.