ServiceNow CAD Practice Test Questions and Exam Dumps Part16 Q301-320

View Full ServiceNow CAD Exam Dumps and Practice Test Dumps.

 

Question 301

Which ServiceNow API is commonly used to determine whether the current user has a specific role?

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

Correct Answer: 4

Explanation

GlideSystem, accessed through the gs object in server-side scripts, provides methods for interacting with the ServiceNow system and current user. One commonly used method is gs.hasRole(), which can determine whether the current user has a specified role. This can be useful when application logic needs to behave differently depending on user permissions. However, role checks in scripts should not replace ACLs when the requirement is actual data security. ACLs provide the appropriate security enforcement mechanism. GlideRecord is used for database operations, GlideForm handles client-side forms, and GlideAggregate performs aggregate queries.

Question 302

Which type of Client Script executes when a user attempts to save a record?

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

Correct Answer: 1

Explanation

An onSubmit Client Script executes when a user attempts to submit a form. It is commonly used for client-side validation before the record is saved. The script can check field values and, when necessary, return false to prevent submission. For example, an application may require a user to provide additional information before submitting a record. An onLoad Client Script executes when the form opens, while an onChange script executes when a specified field changes. Client-side validation improves the user experience, but requirements that must always be enforced should also be handled through appropriate server-side mechanisms.

Question 303

Which ServiceNow feature is used to define relationships between a child table and its parent table?

  1. Reference Qualifier
  2. Data Policy
  3. Table Extension
  4. UI Policy

Correct Answer: 3

Explanation

Table extension allows one ServiceNow table to inherit fields and functionality from another table. The extending table becomes a child of the parent table and can inherit fields, attributes, and behavior defined on the parent. A common example is the Task table, which is extended by tables such as Incident and Change Request. Table extension supports reuse and helps establish a structured data model. A Reference Qualifier filters records in reference fields, while Data Policies and UI Policies address data requirements and form behavior. Understanding inheritance is important when designing custom ServiceNow applications.

Question 304

Which GlideRecord method is used to execute a query after conditions have been specified?

  1. update()
  2. query()
  3. insert()
  4. initialize()

Correct Answer: 2

Explanation

The query() method executes a GlideRecord database query after the required conditions have been established. A typical sequence involves creating a GlideRecord object, using addQuery() to define conditions, calling query(), and then using next() to process each returned record. The query should generally be restricted to only the records required by the application. This helps reduce unnecessary database processing and improves performance. The insert() method creates a new record, update() saves changes to an existing record, and initialize() prepares a GlideRecord for creating a new record.

Question 305

Which ServiceNow feature allows developers to expose custom functionality through HTTP-based endpoints?

  1. Scripted REST API
  2. UI Policy
  3. Data Policy
  4. Dictionary Entry

Correct Answer: 1

Explanation

A Scripted REST API allows developers to create custom HTTP endpoints within ServiceNow. Developers can define API resources, supported HTTP methods, request parameters, and server-side scripts that process incoming requests. This is useful when external applications need access to custom business logic or ServiceNow data that is not adequately handled by standard APIs. Scripted REST APIs can support methods such as GET, POST, PUT, and DELETE depending on the design. Security, authentication, authorization, validation, and error handling should be considered when exposing custom endpoints to external consumers.

Question 306

What is the primary purpose of an application module in ServiceNow?

  1. To store records
  2. To provide navigation to application functionality
  3. To define database indexes
  4. To execute Business Rules

Correct Answer: 2

Explanation

An application module provides a navigation entry that allows users to access specific application functionality. Modules can point users to lists, forms, reports, or other supported destinations. They are normally organized under an Application Menu, which groups related functionality together. Modules do not themselves store database records or execute Business Rules. Their primary purpose is navigation and accessibility. Developers creating custom applications commonly configure menus and modules so users can easily find the application’s records and features. Module visibility can also be influenced by roles and other access configurations.

Question 307

Which object is commonly used to access the current record in a Business Rule?

  1. current
  2. g_form
  3. gs
  4. producer

Correct Answer: 1

Explanation

The current object represents the record currently being processed by a Business Rule. Developers can use it to read or modify field values associated with that record. For example, a Before Business Rule can use current.priority or current.short_description and can assign values to fields before the record is saved. The g_form object is primarily associated with client-side form manipulation, while gs represents GlideSystem. The producer object is commonly associated with Record Producer processing. Understanding the correct server-side objects is essential for writing effective ServiceNow Business Rules.

Question 308

Which feature allows a developer to create a reusable sequence of Flow Designer actions?

  1. Trigger
  2. Data Pill
  3. Subflow
  4. Condition

Correct Answer: 3

Explanation

A Subflow is designed to contain a reusable sequence of Flow Designer steps. Instead of duplicating the same automation logic in multiple flows, developers can place common functionality in a Subflow and invoke it whenever needed. Subflows can accept inputs and return outputs, making them useful for reusable business processes. A Trigger starts a flow, while a Data Pill represents data that can be passed between steps. Conditions control branching or execution logic. Using Subflows improves maintainability because common automation can be managed centrally and reused across different processes.

Question 309

Which method is used to create a new database record with GlideRecord?

  1. query()
  2. next()
  3. update()
  4. insert()

Correct Answer: 4

Explanation

The GlideRecord insert() method creates a new record in the target table. A typical pattern is to create the GlideRecord object, call initialize(), assign values to the required fields, and then call insert(). The method returns information that can be used to identify the newly created record. By contrast, update() is generally used to save modifications to an existing record, while query() retrieves records and next() iterates through query results. Developers should validate required values and avoid unnecessary inserts because each database operation can initiate additional platform processing.

Question 310

Which ServiceNow mechanism is most appropriate for enforcing mandatory data requirements regardless of whether data comes through a form or another supported interface?

  1. UI Action
  2. Data Policy
  3. Form Layout
  4. Application Menu

Correct Answer: 2

Explanation

A Data Policy can enforce data requirements beyond the behavior of a particular form. This makes it useful when an organization needs consistent data validation across different ways of creating or updating records. For example, a field can be required when a particular condition is met. UI Policies can also make fields mandatory on forms, but they primarily address client-side form behavior. Data Policies are better suited when the requirement should apply more broadly. Developers should understand the distinction between user-interface behavior and server-side data enforcement when choosing the appropriate platform feature.

Question 311

Which GlideRecord method retrieves a record using its sys_id?

  1. get()
  2. query()
  3. next()
  4. addQuery()

Correct Answer: 1

Explanation

The get() method can retrieve a specific GlideRecord when its unique identifier, such as a sys_id, is known. For example, gr.get(recordSysId) loads the corresponding record into the GlideRecord object. This is convenient when an application needs to work with one known record rather than execute a query that may return multiple records. query() executes a database query, addQuery() defines query conditions, and next() iterates through query results. Using get() appropriately can simplify scripts and avoid unnecessary query logic when the unique record identifier is already available.

Question 312

Which ServiceNow component is designed to store server-side reusable JavaScript logic?

  1. UI Policy
  2. Script Include
  3. Client Script
  4. Form Layout

Correct Answer: 2

Explanation

A Script Include stores reusable server-side JavaScript logic in ServiceNow. Developers can place functions or classes in Script Includes and call them from other server-side components. This helps prevent duplicate code and provides a centralized location for shared application functionality. Script Includes can also be configured for client-side access through GlideAjax when appropriate. Client Scripts execute in the browser, UI Policies manage dynamic form behavior, and Form Layout controls the arrangement of fields. Reusable Script Includes contribute to cleaner application architecture and make maintenance easier because shared logic can be updated in one place.

Question 313

Which API is commonly used to manipulate fields on the current ServiceNow form from client-side code?

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

Correct Answer: 3

Explanation

GlideForm, commonly accessed through the g_form object, provides client-side methods for interacting with fields on the current form. Developers can use it to set values, retrieve values, show or hide fields, make fields mandatory, make fields read-only, and display messages. GlideForm is commonly used by Client Scripts and other client-side functionality. GlideRecord is primarily a server-side database API, GlideSystem provides system-level server-side functionality, and GlideAggregate performs aggregate database queries. Understanding GlideForm is essential for implementing dynamic form behavior without unnecessarily using server-side processing.

Question 314

Which ServiceNow feature is used to capture configuration changes so they can be moved between instances?

  1. Transform Map
  2. Update Set
  3. Import Set
  4. Record Producer

Correct Answer: 2

Explanation

An Update Set is used to capture many configuration changes made in a ServiceNow instance so they can be transferred to another instance. Developers commonly use Update Sets when moving application configuration from development to test and eventually to production. An Update Set can capture supported configuration records while changes are being made. Before deployment, developers should review the captured records and verify that all required dependencies are included. Import Sets and Transform Maps deal primarily with data imports, while Record Producers provide a user interface for creating records. Update Sets therefore support controlled application configuration migration.

Question 315

Which method is used to iterate through records returned by a GlideRecord query?

  1. next()
  2. insert()
  3. deleteRecord()
  4. initialize()

Correct Answer: 1

Explanation

The GlideRecord next() method moves the current GlideRecord object to the next record returned by a query. It is commonly used in a while loop to process each matching record. A typical pattern is to define conditions with addQuery(), execute the query with query(), and then use while (gr.next()) to process the results. insert() creates a new record, deleteRecord() removes a record, and initialize() prepares an object for a new record. Efficient use of next() and properly restricted queries is important for good database performance.

Question 316

Which ServiceNow feature can automatically send an email when a specified record condition or event occurs?

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

Correct Answer: 2

Explanation

A Notification can automatically send email messages when configured record conditions or events occur. Notifications can specify recipients, subject information, message content, and triggering criteria. They are commonly used for assignments, approvals, state changes, escalations, and other business processes. Notifications can also be triggered through ServiceNow events, providing a flexible event-driven communication model. Business Rules can generate events or perform other server-side processing, but their primary purpose is not email delivery. UI Actions provide interactive controls, while Dictionary Entries define field metadata. Notifications therefore provide the standard mechanism for automated email communication.

Question 317

Which object is commonly used in a Record Producer to access the values entered into its variables?

  1. current
  2. producer
  3. gs
  4. g_form

Correct Answer: 2

Explanation

In Record Producer scripting, the producer object provides access to values entered through the Record Producer variables. Developers can use these values to populate fields on the record being created. This allows a Record Producer to present a simplified interface while still creating a properly populated record in a target table. The current object is commonly associated with Business Rules, g_form is used for client-side form manipulation, and gs provides GlideSystem functionality. Understanding the Record Producer scripting context is important when mapping catalog-style user input to fields on the resulting record.

Question 318

Which API is commonly used to perform calculations such as record counts and sums at the database level?

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

Correct Answer: 3

Explanation

GlideAggregate is designed for database-level aggregation operations. It can calculate values such as counts, sums, minimums, maximums, and averages and can also support grouping. Using GlideAggregate can be more efficient than retrieving large numbers of records with GlideRecord and performing calculations manually in JavaScript. This is particularly useful for reporting, dashboards, and server-side processing where only aggregated information is required. GlideForm handles form interaction, GlideAjax facilitates client-to-server communication, and GlideUser provides information about the current user. Selecting GlideAggregate for aggregation can help reduce unnecessary data processing.

Question 319

Which component is used to define a custom button or link that performs an action on a ServiceNow form?

  1. UI Action
  2. UI Policy
  3. Data Policy
  4. Reference Qualifier

Correct Answer: 1

Explanation

A UI Action allows developers to add custom buttons, links, and menu actions to ServiceNow forms and lists. The action can be configured with conditions and scripts so that it is available only when appropriate. For example, a UI Action could allow a user to close a record, create a related record, or perform a custom processing operation. UI Policies control field behavior, Data Policies enforce data requirements, and Reference Qualifiers filter records in reference fields. UI Actions are therefore the appropriate platform component for adding interactive operations to a ServiceNow user interface.

Question 320

Which ServiceNow feature is used to control access to a specific field based on roles, conditions, or scripts?

  1. Form Layout
  2. Application Menu
  3. Field ACL
  4. UI Policy

Correct Answer: 3

Explanation

A field-level ACL controls access to a specific field and can determine whether users are allowed to read or modify that field. ACL evaluation can involve roles, conditions, and scripts depending on the configuration. Field ACLs are important when sensitive information must be protected even though the user can access the overall record. UI Policies can make fields hidden, mandatory, or read-only on a form, but they are not a replacement for security controls. Form Layout controls field presentation, while Application Menus provide navigation. Field ACLs should therefore be used when actual access control is required.