Free CAD Exam Braindumps (page: 6)

Page 5 of 70

Which one of the following is true?

  1. A UI Policy's Actions execute before the UI Policy's Scripts
  2. The execution order for a UI Policy's Scripts and Actions is determined at runtime
  3. A UI Policy's Scripts execute before the UI Policy's Actions
  4. A UI Policy's Actions and Scripts execute at the same time

Answer(s): A

Explanation:

Created UI policy on incident form, action set's cmdb_ci field as mandatory and script as not. result, field was not mandatory.

A UI Policy's Actions execute before the UI Policy's Scripts. Actions are predefined operations that can be applied to fields or sections, such as making them mandatory, read-only, visible, or setting a default value. Scripts are custom JavaScript code that can be used to perform more complex logic or validations. Actions are executed first, and then Scripts are executed if the UI Policy conditions are met.


Reference:

[ServiceNow Docs - UI policy actions], [ServiceNow Docs - UI policy scripts]



Here is the Business Rule script template:



This type of JavaScript function is known as:

  1. Constructor
  2. Scoped
  3. Anonymous
  4. Self-invoking

Answer(s): D

Explanation:

Self-invoking. Learn JavaScript!

This type of JavaScript function is known as self-invoking or immediately-invoked function expression (IIFE). It is a function that is defined and executed at the same time, without being assigned to a variable or being called by another function. It is often used to create a local scope for variables and avoid polluting the global namespace.


Reference:

[W3Schools - JavaScript Function Definitions], [MDN Web Docs - Immediately-invoked function expressions]



Which method call returns true only if the currently logged in user has the catalog_admin role and in no other case?

  1. g_user.hasRole(`catalog_admin')
  2. g_user.hasRoleExactly(`catalog_admin')
  3. g_user.hasRoleOnly(`catalog_admin')
  4. g_user.hasRoleFromList(`catalog_admin')

Answer(s): B

Explanation:

The method call that returns true only if the currently logged in user has the catalog_admin role and in no other case is g_user.hasRoleExactly(`catalog_admin'). This method checks if the user has exactly one role, and returns true if it matches the argument. The other methods return true if the user has one or more roles, or if the user has any role from a list of arguments.


Reference:

[ServiceNow Docs - GlideUser API], [ServiceNow Community - Difference between hasRole() and hasRoleExactly()]


https://community.servicenow.com/community? id=community_QUESTION NO :&sys_id=dff705e6db7757c0d58ea345ca96196b



There is a basic strategy when creating a Utils Script Include. Identify the step that does not belong.

  1. Identify the table
  2. Script the function(s)
  3. Create a class
  4. Create a prototype object from the new class

Answer(s): A

Explanation:

The step that does not belong when creating a Utils Script Include is identifying the table. A Script Include is a server-side script that can contain one or more classes or functions that can be reused by other scripts. It does not depend on a specific table, but can access any table through GlideRecord or other APIs. The other steps are part of creating a Script Include class and its prototype object.


Reference:

[ServiceNow Docs - Script Includes], [ServiceNow Docs - GlideRecord API]






Post your Comments and Discuss ServiceNow® CAD exam with other Community members:

CAD Discussions & Posts