- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 02:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 02:19 AM
Hi
Ram2497
UI Policies execute after Client Scripts. If there is conflicting logic between a Client Script and a UI Policy, the UI Policy logic applies.
Client-based code:
"Client-based code that executes in the browser, using Ajax or running as Javascript, always executes before the form submission to the server."
This includes Client scripts and UI Policies.
First onLoad Client scripts, after that the first UI Policies kick in.
After that, the Client scripts and UI Policies that work onChange.
After that, the Client scripts that work onSubmit.
Refer the below link may helpful you.
https://community.servicenow.com/community?id=community_blog&sys_id=512d26e5dbd0dbc01dcaf3231f9619ce
Thanks & Regards
Haseena
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 02:19 AM
Hi
Ram2497
UI Policies execute after Client Scripts. If there is conflicting logic between a Client Script and a UI Policy, the UI Policy logic applies.
Client-based code:
"Client-based code that executes in the browser, using Ajax or running as Javascript, always executes before the form submission to the server."
This includes Client scripts and UI Policies.
First onLoad Client scripts, after that the first UI Policies kick in.
After that, the Client scripts and UI Policies that work onChange.
After that, the Client scripts that work onSubmit.
Refer the below link may helpful you.
https://community.servicenow.com/community?id=community_blog&sys_id=512d26e5dbd0dbc01dcaf3231f9619ce
Thanks & Regards
Haseena
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 02:21 AM
Hi Ram,
First Client script runs then UI policies runs.
Reply again if need further help.
Hit Correct/Helpful, if this helps you.
Warm Regards,
Devyani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2019 05:52 AM
This is totally depends on ''Order no" which you specify. .....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2020 12:23 AM
Check out this video, it will clear all your doubts and help you to understand Client Script queries in details.
Link: https://www.youtube.com/watch?v=Wj8ZAWtTBqo&ab_channel=ServiceNowHelpdesk
It help you to understand below points.
- UI policy and Client script
- why client script run first in service now?.
- Which rule execute first client Scripts or UI polices?
- g_user and g_form tips
- Difference between client script and script include (server).
- Scenario based implementation
- Understanding below
- onLoad()
- onChange()
- onSubmit()
- onCellEdit()
Please mark reply as Helpful/Correct, if applicable. Thanks!!