ServiceNow CAD Practice Test Questions and Exam Dumps Part8 Q141-160

View Full ServiceNow CAD Exam Dumps and Practice Test Dumps.

 

Question 141

Which API is commonly used in a server-side script to query and manipulate records in ServiceNow?

  1. GlideRecord
  2. GlideAjax
  3. GlideForm
  4. GlideUser

Correct Answer: 1

Explanation

GlideRecord is the primary server-side API used to interact with ServiceNow database records. Developers can use it to query tables, retrieve records, insert new records, update existing records, and delete records when appropriate. A GlideRecord object represents a set of records from a particular table. Methods such as addQuery(), query(), next(), insert(), and update() are frequently used with GlideRecord. GlideAjax, in contrast, is mainly used for client-to-server communication. GlideForm is a client-side API for manipulating forms, while GlideUser provides information about the current user. Therefore, GlideRecord is the appropriate choice for server-side database operations.

Question 142

Which type of Business Rule runs after a record has been saved to the database?

  1. Before
  2. Display
  3. After
  4. On Submit

Correct Answer: 3

Explanation

An After Business Rule executes after the current record has been written to the database. It is useful when an action should occur after the database operation succeeds, such as updating related records, creating additional records, or triggering other server-side processing. Before Business Rules execute before the database operation and are commonly used to modify values on the current record. Display Business Rules execute when a record is loaded and can pass server-side information to the client. “On Submit” is associated with Client Scripts rather than Business Rules. Selecting the correct Business Rule timing is important because execution timing affects data consistency and application behavior.

Question 143

Which ServiceNow feature is primarily used to control whether users can read, write, create, or delete records?

  1. UI Policy
  2. Client Script
  3. Access Control List (ACL)
  4. Data Lookup

Correct Answer: 3

Explanation

Access Control Lists, commonly called ACLs, provide record-level and field-level security in ServiceNow. ACL rules can control operations such as read, write, create, and delete. They can also contain roles, conditions, and scripts that determine whether access should be granted. UI Policies and Client Scripts primarily control behavior on the client side and should not be treated as security mechanisms. Data Lookup rules are designed to populate or update field values based on matching conditions. When protecting sensitive data or restricting user access to records and fields, developers should use ACLs rather than relying on client-side configuration.

Question 144

What is the main purpose of a Script Include?

  1. To define database indexes
  2. To store reusable server-side JavaScript logic
  3. To configure form layouts
  4. To create application menus

Correct Answer: 2

Explanation

A Script Include stores reusable server-side JavaScript that can be called from other server-side scripts. This promotes code reuse and helps developers avoid duplicating the same logic across Business Rules, Scheduled Script Executions, Script Actions, and other server-side components. Script Includes can contain classes, functions, or utility methods depending on the implementation. Some Script Includes can also be configured as client-callable so that client-side scripts can communicate with them through GlideAjax. They are not primarily used for form layouts, application menus, or database indexes. Well-designed Script Includes improve maintainability by centralizing business logic in reusable server-side components.

Question 145

Which method is commonly used with GlideRecord to retrieve the next record in a query result?

  1. fetch()
  2. retrieve()
  3. getNext()
  4. next()

Correct Answer: 4

Explanation

The next() method is commonly used with GlideRecord to move through the records returned by a query. A typical server-side pattern is to create a GlideRecord object, add query conditions, execute query(), and then use while (gr.next()) to process each returned record. The next() method returns true when another record is available and moves the GlideRecord object to that record. Methods such as fetch() and retrieve() are not the standard GlideRecord iteration methods. Understanding the query and iteration sequence is essential for writing reliable ServiceNow server-side scripts and avoiding incorrect record processing.

Question 146

Which Client Script type executes when a form is initially loaded?

  1. onLoad
  2. onChange
  3. onSubmit
  4. onCellEdit

Correct Answer: 1

Explanation

An onLoad Client Script executes when a form is loaded in the browser. Developers commonly use it to initialize field values, hide or display fields, make fields mandatory or read-only, or perform other client-side form initialization. An onChange Client Script runs when the value of a specified field changes. An onSubmit Client Script executes when the user attempts to submit the form and can be used to validate information before submission. onCellEdit is associated with editing list cells rather than standard form loading. Choosing the correct Client Script type ensures that the desired client-side logic executes at the appropriate point in the user interaction.

Question 147

What does the addQuery() method do in GlideRecord?

  1. Inserts a new record
  2. Adds a condition to a database query
  3. Deletes the current record
  4. Updates a field value

Correct Answer: 2

Explanation

The GlideRecord addQuery() method adds a condition to the query that will be executed against a ServiceNow table. For example, a developer can use gr.addQuery(‘active’, true) to restrict results to active records. Multiple addQuery() calls can be used to build more complex query conditions. After defining the conditions, query() executes the query and the resulting records can be processed using next(). addQuery() does not insert, update, or delete records. Understanding query construction is important because poorly designed queries can return unnecessary records and negatively affect application performance.

Question 148

Which feature allows a developer to create a reusable sequence of actions that can be invoked from multiple Flow Designer flows?

  1. Business Rule
  2. UI Action
  3. Subflow
  4. Dictionary Entry

Correct Answer: 3

Explanation

A Subflow in Flow Designer is designed to package reusable automation logic that can be invoked by multiple flows or other subflows. This allows developers to centralize common processes rather than rebuilding the same sequence of actions repeatedly. Subflows can accept inputs and can provide outputs, making them useful for reusable business processes. Business Rules execute server-side logic based on database events, UI Actions provide buttons or links on forms and lists, and Dictionary Entries define metadata for fields and tables. Using Subflows can improve maintainability because a change to common automation logic can be made in one reusable component.

Question 149

Which object is commonly used in a Client Script to manipulate fields on the current form?

  1. GlideForm
  2. GlideRecord
  3. GlideAggregate
  4. GlideSystem

Correct Answer: 1

Explanation

GlideForm, commonly represented by the g_form object, provides methods for interacting with fields and other elements on the current ServiceNow form. Developers can use methods such as setValue(), getValue(), setVisible(), setMandatory(), and setReadOnly() to control form behavior. GlideRecord is primarily a server-side database API, while GlideAggregate is used for aggregate database queries. GlideSystem, represented by gs, provides server-side system functionality such as logging and user information. Because Client Scripts execute in the browser, GlideForm is the standard API for manipulating fields and controlling client-side form behavior.

Question 150

What is the primary purpose of a reference field?

  1. To store an image file
  2. To store a relationship to a record in another table
  3. To create a database index automatically
  4. To execute server-side scripts

Correct Answer: 2

Explanation

A reference field stores a relationship to a record in another ServiceNow table. For example, a reference field on an Incident can point to a User record in the User table. The database stores the referenced record’s unique identifier, while the interface generally displays the referenced record’s display value. Reference fields also support features such as reference qualifiers, which can restrict the records available for selection. They are important for establishing relationships between tables while maintaining data consistency. Reference fields do not directly execute scripts, store image files, or automatically create database indexes.

Question 151

Which ServiceNow component is used to define fields and their attributes for a table?

  1. Notification
  2. Dictionary Entry
  3. UI Action
  4. Script Action

Correct Answer: 2

Explanation

Dictionary Entries define metadata about tables and fields in ServiceNow. They can specify attributes such as field type, length, default value, reference table, mandatory behavior, and other field-level properties. Developers and administrators use dictionary configuration to control how data fields behave and how they are represented within the platform. Notifications are used to communicate information to users, UI Actions provide interactive buttons or links, and Script Actions respond to events with server-side logic. Dictionary Entries are therefore a fundamental part of ServiceNow application development because they define the structure and behavior of data fields.

Question 152

Which API is commonly used to communicate from a client-side script to a server-side Script Include?

  1. GlideRecord
  2. GlideAggregate
  3. GlideAjax
  4. GlideElement

Correct Answer: 3

Explanation

GlideAjax enables client-side JavaScript to call server-side logic contained in a client-callable Script Include. This is useful when a Client Script needs information that should be retrieved or processed on the server. The client sends parameters through GlideAjax, and the Script Include processes the request and returns a response. GlideRecord is normally used for server-side database operations and should not be directly used in standard client-side scripts. GlideAggregate performs aggregate queries, while GlideElement represents field elements. GlideAjax helps separate client-side presentation logic from server-side data processing and can reduce unnecessary data exposure.

Question 153

What is the purpose of a Transform Map in an Import Set process?

  1. To map imported data to fields in a target table
  2. To create user roles automatically
  3. To control form visibility
  4. To configure email templates

Correct Answer: 1

Explanation

A Transform Map defines how data from an Import Set staging table is transformed and moved into a target ServiceNow table. It maps source fields to target fields and can include field maps, scripts, coalesce settings, and transformation logic. Import Sets are commonly used to bring external data into ServiceNow, while the Transform Map determines how that staged data should be processed. Transform Maps are not primarily responsible for configuring forms, email templates, or roles. Proper transformation design is important for maintaining data quality and preventing duplicate or incorrectly mapped records during data imports.

Question 154

Which Client Script type can prevent a form from being submitted when validation fails?

  1. onLoad
  2. onChange
  3. onSubmit
  4. onDisplay

Correct Answer: 3

Explanation

An onSubmit Client Script executes when a user attempts to submit a form. It can perform client-side validation and return false to prevent submission when required conditions are not satisfied. For example, a developer may validate that certain information has been entered before allowing the record to save. onLoad executes when the form loads, while onChange executes when a specified field changes. Client-side validation should be designed carefully because it is not a replacement for server-side security controls. ACLs and server-side validation are still important when data integrity or security must be enforced regardless of the client interface.

Question 155

Which method is commonly used to retrieve a single record by its sys_id using GlideRecord?

  1. get()
  2. fetchOne()
  3. retrieveById()
  4. findRecord()

Correct Answer: 1

Explanation

The GlideRecord get() method can retrieve a specific record, commonly by its sys_id. For example, gr.get(sys_id) attempts to load the record whose unique identifier matches the supplied value. It can also be used with a field name and value in appropriate scenarios. Once the record is retrieved, its fields can be accessed or modified according to the script’s purpose. Methods such as fetchOne(), retrieveById(), and findRecord() are not the standard GlideRecord methods for this purpose. Using get() is especially useful when a script already has a known record identifier.

Question 156

What is the primary purpose of an Update Set?

  1. To execute scheduled jobs
  2. To package configuration changes for movement between instances
  3. To create database backups
  4. To manage user passwords

Correct Answer: 2

Explanation

Update Sets are used to capture configuration changes made in a ServiceNow instance so those changes can be moved to another instance. They commonly support development and deployment activities between environments such as development, testing, and production. Update Sets can capture many configuration records, including Business Rules, Client Scripts, UI Policies, and other application configuration. They are not intended to function as full database backups or password-management tools. Developers should review captured changes carefully and follow appropriate deployment practices. For larger application development processes, source control and application repository capabilities may also be used depending on the organization’s development model.

Question 157

Which Flow Designer component is designed to perform a specific operation within a flow?

  1. Action
  2. Table
  3. Dictionary
  4. ACL

Correct Answer: 1

Explanation

An Action in Flow Designer represents a specific operation that can be performed as part of a flow. ServiceNow provides many prebuilt actions, and developers can also create custom actions when specialized functionality is required. Actions can accept inputs and generate outputs that can be used by subsequent flow steps. Tables define data structures, Dictionary Entries define field metadata, and ACLs control access to data. By using actions, Flow Designer allows developers to build automation using reusable building blocks rather than implementing every process entirely with custom scripts. This supports maintainability and makes business process automation easier to understand.

Question 158

Which statement about a scoped application is correct?

  1. It cannot contain Script Includes
  2. It provides boundaries that help isolate application artifacts and logic
  3. It can only contain client-side scripts
  4. It cannot have tables

Correct Answer: 2

Explanation

A scoped application provides an application boundary that helps isolate its artifacts, data, and logic from other applications. Scope can help control access between applications and reduce unintended conflicts between similarly named objects. A scoped application can contain tables, Script Includes, Business Rules, Client Scripts, UI Policies, modules, and many other application components. Cross-scope access may require appropriate configuration or privileges when one application needs to interact with another. Understanding application scope is important for developing maintainable applications because it helps establish clear ownership and boundaries for application components.

Question 159

Which ServiceNow feature can automatically send an email when specified conditions are met on a record?

  1. Dictionary Entry
  2. Notification
  3. Reference Qualifier
  4. UI Policy

Correct Answer: 2

Explanation

Notifications are used to send messages to users or groups when specified conditions or events occur. A notification can be configured with conditions, recipients, a subject, a message body, and other options. Notifications can be triggered by record changes or by events generated elsewhere in the platform. Dictionary Entries define field metadata, Reference Qualifiers restrict available reference records, and UI Policies control form behavior. Notifications are an important part of application communication because they allow users to receive relevant information without manually checking records. Developers should configure conditions carefully to prevent unnecessary or excessive email notifications.

Question 160

What is the main purpose of a Reference Qualifier?

  1. To restrict which records are available in a reference field
  2. To create a new database table
  3. To execute a scheduled script
  4. To define user authentication

Correct Answer: 1

Explanation

A Reference Qualifier restricts the records that can be selected in a reference field. For example, a reference field could be configured to display only active users belonging to a particular department. Qualifiers can be simple conditions or more dynamic depending on the implementation. They improve usability by limiting irrelevant choices and can help users select appropriate related records. However, a Reference Qualifier should not be considered a substitute for security controls such as ACLs. It primarily controls which records are presented for selection in the reference field rather than determining whether a user is ultimately authorized to access the underlying data.