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

Exam CAD All Questions

View all questions & answers for the CAD exam

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: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
nsmcan
Highly Voted 3 years, 1 month 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, 5 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 months, 4 weeks 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
3 months, 3 weeks ago
A. tested in PDI
upvoted 1 times
...
sahithi2004
4 months, 1 week 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
5 months 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
5 months ago
Correct is A: General Order: -UI Scripts -Client Scripts -UI Policy Action -UI Policy Scripts
upvoted 1 times
...
51f8ce8
5 months, 1 week ago
Correct answer is A. UI Policy action executes before scripts.
upvoted 1 times
...
chrisRY
5 months, 3 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
6 months, 1 week ago
Selected Answer: C
The correct is C
upvoted 1 times
georgeg4
6 months 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
7 months, 2 weeks 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
8 months, 1 week 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
8 months, 1 week ago
Selected Answer: C
I think the answer is C
upvoted 3 times
...
MacGyver4th
9 months, 3 weeks 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
10 months, 1 week 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
10 months, 1 week 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
12 months 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 ...