Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam CAD topic 1 question 17 discussion

Actual exam question from ServiceNow's CAD
Question #: 17
Topic #: 1
[All CAD Questions]

Which one of the following is true?

  • A. A UI Policy's Actions execute before the UI Policy's Scripts
  • B. The execution order for a UI Policy's Scripts and Actions is determined at runtime
  • C. A UI Policy's Scripts execute before the UI Policy's Actions
  • D. A UI Policy's Actions and Scripts execute at the same time
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Reference:
https://community.servicenow.com/community?id=community_question&sys_id=5cf5d3f7db72f784f7fca851ca96199b

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
nsmcan
Highly Voted 2 years, 10 months ago
Correct answer is A. I didn't find any definite statements about order in the docs. However in the link, quoted for this question, there are two opposite responses. One, which takes UI Policy Actions first and UI Policy Scripts second, was marked helpful by ServiceNow and Expert(s)
upvoted 13 times
...
Haikz
Highly Voted 2 years, 3 months ago
Selected Answer: A
A is correct, verified. Created UI policy on incident form, action set's cmdb_ci field as mandatory and script as not. result, field was not mandatory.
upvoted 9 times
...
RoadtoCad
Most Recent 2 weeks, 4 days ago
The answer is A Actions execute first: When a UI Policy is triggered, the Actions are applied first. This ensures that the form is updated (fields are shown, hidden, made mandatory, etc.) before any custom scripts are run. Scripts execute after Actions: Once the Actions have been applied, the UI Policy Scripts are then executed. This allows the script to work with the form in its updated state.
upvoted 1 times
...
DKey
1 month, 2 weeks ago
A. tested in PDI
upvoted 1 times
...
sahithi2004
1 month, 3 weeks ago
Selected Answer: A
In ServiceNow, when a UI Policy is triggered, its actions (such as setting fields to mandatory, visible, or read-only) are executed before any scripts associated with the UI Policy are run.
upvoted 1 times
...
CodingAmo
2 months, 3 weeks ago
Selected Answer: A
The Scripting in ServiceNow Fundamentals course section called Catalog Client Scripts and Catalog UI Policies which is found in the student instance has a KBA #KB86753O9 that states "UI Policy Actions execute before UI Policy Scripts".
upvoted 1 times
...
jutorri
2 months, 3 weeks ago
Correct is A: General Order: -UI Scripts -Client Scripts -UI Policy Action -UI Policy Scripts
upvoted 1 times
...
51f8ce8
2 months, 4 weeks ago
Correct answer is A. UI Policy action executes before scripts.
upvoted 1 times
...
chrisRY
3 months, 2 weeks ago
This video goes over Answer A - https://www.google.com/search?client=opera&q=UI+Policy%27s+Actions+execute+before+the+UI+Policy%27s+Scripts&sourceid=opera&ie=UTF-8&oe=UTF-8#fpstate=ive&vld=cid:63e72bd4,vid:TptpAXlLT10,st:0
upvoted 1 times
...
georgeg4
3 months, 3 weeks ago
Selected Answer: C
The correct is C
upvoted 1 times
georgeg4
3 months, 3 weeks ago
https://developer.servicenow.com/dev.do#!/learn/courses/washingtondc/app_store_learnv2_scripting_washingtondc_scripting_in_servicenow/app_store_learnv2_scripting_washingtondc_client_side_scripting/app_store_learnv2_scripting_washingtondc_client_scripts_vs_ui_policies
upvoted 1 times
...
...
Chanti1243
5 months ago
C UI Policy’s Scripts execute before the UI Policy’s Actions (Option C): This statement is accurate. When a UI Policy is triggered, its script runs first. The script evaluates conditions and performs any necessary modifications. If the conditions are met, the associated actions (such as hiding fields or setting field values) are then executed.
upvoted 1 times
...
Checwes
5 months, 4 weeks ago
Selected Answer: A
Just tested in my PDI. 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); Answer is A.
upvoted 1 times
...
manikanta_gnbv
6 months ago
Selected Answer: C
I think the answer is C
upvoted 3 times
...
MacGyver4th
7 months, 1 week ago
Selected Answer: C
I tested this on the incident form in a Vancouver PDI by modifying the "Fields set to mandatory for all states" UI policy. I changed the "When to Apply" condition to when the state was "In Progress" I enabled "Run scripts" and added code in the "Execute if true" section **I keep getting bad gateway errors when I try to submit with the code** When the form loads, the caller and short descriptions fields are not mandatory. When I select "In Progress" for the state, after about 5 seconds the caller and short description fields become mandatory. This tells me that the script runs before the actions. The answer is C
upvoted 3 times
...
evoken
7 months, 3 weeks ago
In ServiceNow, UI Policies are used to dynamically change the behavior of form elements based on certain conditions. A UI Policy consists of both Scripts and Actions. Scripts: These are JavaScript code snippets that execute when the conditions specified in the UI Policy are met. They are typically used for more complex logic and calculations. Actions: These are predefined operations that can be applied to form elements when the conditions are met. Examples include showing or hiding a field, making a field mandatory, or setting a default value. The correct order of execution is that the Scripts execute before the Actions. The JavaScript code in the Scripts section is evaluated first, and based on the results, the corresponding Actions are then executed. So, option C is the correct statement.
upvoted 3 times
...
D_Ogi
8 months ago
A https://www.servicenow.com/community/developer-forum/which-executes-first-ui-policy-action-or-ui-policy-script/m-p/2666819/highlight/true#M1034196
upvoted 1 times
...
zoro69
9 months, 3 weeks ago
C is correct logically
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...