View Full ServiceNow CAD Exam Dumps and Practice Test Dumps.
Question 201
Which ServiceNow API is primarily used to retrieve and manipulate database records on the server?
- GlideForm
- GlideAjax
- GlideRecord
- GlideUser
Correct Answer: 3
Explanation
GlideRecord is the primary server-side API for interacting with records stored in ServiceNow tables. Developers can use it to query records, retrieve specific records, insert new records, update existing records, and delete records. Common methods include addQuery(), query(), next(), get(), insert(), and update(). GlideForm is mainly used for client-side form manipulation, GlideAjax supports communication between client and server, and GlideUser provides information about the current user. Developers should use GlideRecord carefully and construct efficient queries to avoid unnecessary database operations that could negatively affect application performance.
Question 202
Which type of Client Script is executed when a form is first opened?
- onLoad
- onChange
- onSubmit
- onCellEdit
Correct Answer: 1
Explanation
An onLoad Client Script executes when a ServiceNow form is loaded in the user’s browser. It is commonly used to initialize fields, set field states, display information, or perform other client-side actions when the form opens. An onChange Client Script runs when a specific field value changes, while an onSubmit Client Script runs when the user attempts to submit the form. onCellEdit is associated with editing values directly in lists. Developers should use the appropriate Client Script type based on when the required behavior should occur. Using onLoad unnecessarily for complex operations can affect form loading performance.
Question 203
Which component is used to define server-side logic that executes before a record is saved?
- UI Action
- Before Business Rule
- Client Script
- UI Policy
Correct Answer: 2
Explanation
A Before Business Rule executes before the current record is written to the database. It is commonly used to modify values on the current record, perform server-side validation, calculate values, or enforce business logic before saving. Because it runs as part of the database transaction, changes made to the current record can be saved without requiring another update operation. Client Scripts and UI Policies operate primarily on the client side, while UI Actions provide user-triggered controls. Before Business Rules should be kept efficient because they execute during the user’s transaction and can directly affect transaction performance.
Question 204
Which ServiceNow feature allows a developer to define reusable automation logic that can be called from multiple flows?
- Dictionary Entry
- UI Policy
- Subflow
- Form Layout
Correct Answer: 3
Explanation
A Subflow in Flow Designer is designed to package reusable automation logic that can be called from multiple flows or other subflows. Subflows can define inputs and outputs, making them suitable for common business processes that need to be reused in different situations. This approach reduces duplicated configuration and makes automation easier to maintain. Dictionary Entries define field metadata, UI Policies control client-side field behavior, and Form Layout controls form presentation. By creating reusable Subflows, developers can centralize common process logic and update it in one location when business requirements change.
Question 205
Which method is used to initialize a GlideRecord object before creating a new record?
- initialize()
- prepare()
- createRecord()
- start()
Correct Answer: 1
Explanation
The GlideRecord initialize() method prepares a GlideRecord object for creating a new record. After initializing the object, a developer can assign values to fields and then use insert() to create the record in the database. A typical sequence is to create the GlideRecord object, call initialize(), set field values, and call insert(). The other listed methods are not standard GlideRecord methods for preparing a new record. Proper initialization helps ensure that the developer is working with a new record rather than unintentionally modifying an existing one retrieved through a query.
Question 206
Which ServiceNow feature controls whether a user can read or modify a specific field?
- Form Layout
- UI Action
- Access Control List
- Notification
Correct Answer: 3
Explanation
An Access Control List, or ACL, can control access to tables and individual fields. ACLs can define whether users are allowed to perform operations such as read, write, create, or delete. Depending on the configuration, ACLs can evaluate roles, conditions, and scripts. Form Layout only controls which fields are presented and their arrangement, while UI Actions provide interactive controls and Notifications send messages. Security should be implemented with ACLs rather than relying on client-side mechanisms such as UI Policies or Client Scripts. Proper ACL design is essential when protecting sensitive application data.
Question 207
Which API is commonly represented by the g_form object?
- GlideSystem
- GlideForm
- GlideRecord
- GlideAggregate
Correct Answer: 2
Explanation
The g_form object represents GlideForm and is used in client-side scripts to interact with the current ServiceNow form. Developers can use GlideForm methods to retrieve and set field values, control field visibility, make fields mandatory or read-only, display messages, and perform other client-side operations. GlideRecord is primarily a server-side database API, GlideSystem provides server-side system functionality, and GlideAggregate performs aggregate database queries. Since Client Scripts run in the user’s browser, GlideForm is the standard API for manipulating the current form. Developers should use the appropriate GlideForm method for each form requirement.
Question 208
What is the main purpose of a Transform Map?
- To define how imported data maps to a target table
- To create user roles
- To configure form buttons
- To manage application scopes
Correct Answer: 1
Explanation
A Transform Map defines how data from an Import Set staging table is transformed and transferred into a target ServiceNow table. It can contain field mappings, scripts, coalesce settings, and other transformation logic. Transform Maps are commonly used when importing data from external systems, spreadsheets, or other sources. They help ensure that source information is correctly mapped to the appropriate target fields. User roles, form buttons, and application scopes are configured through different platform components. Proper Transform Map configuration is especially important when importing large datasets because incorrect mappings can create inaccurate or duplicate records.
Question 209
Which method is used to add a condition to a GlideRecord query?
- setCondition()
- addQuery()
- where()
- filterQuery()
Correct Answer: 2
Explanation
The addQuery() method adds conditions to a GlideRecord query. For example, a developer can use gr.addQuery(‘active’, true) to return only active records. Multiple conditions can be added to create more specific queries. After defining the conditions, the query() method executes the database query, and next() can then be used to iterate through the returned records. The other listed methods are not standard GlideRecord methods for adding query conditions. Efficient query construction is important because retrieving unnecessary records can consume database and server resources and negatively affect application performance.
Question 210
Which feature is designed to send automated messages to users when specified conditions or events occur?
- Notification
- Dictionary Entry
- Form Layout
- Reference Qualifier
Correct Answer: 1
Explanation
Notifications are used to send automated messages to users or groups when defined conditions or events occur. A Notification can specify recipients, subject information, message content, conditions, and other configuration options. Notifications can be triggered by record changes or by events generated within ServiceNow. Dictionary Entries define field metadata, Form Layout controls form presentation, and Reference Qualifiers restrict records available in reference fields. Developers should configure Notification conditions carefully to ensure users receive relevant information without generating excessive or unnecessary messages.
Question 211
Which method is used to retrieve a record by its sys_id using GlideRecord?
- find()
- get()
- retrieve()
- lookup()
Correct Answer: 2
Explanation
The GlideRecord get() method can retrieve a specific record using its sys_id. For example, gr.get(sys_id) attempts to retrieve the record whose unique identifier matches the supplied value. Once the record has been retrieved, its fields can be read or modified depending on the purpose of the script. The get() method can also be used with an appropriate field and value combination. Methods such as find(), retrieve(), and lookup() are not the standard GlideRecord method for this purpose. Using get() is especially useful when a script already knows the unique identifier of a record.
Question 212
Which feature allows an external application to call custom endpoints hosted by ServiceNow?
- UI Policy
- Scripted REST API
- Client Script
- Data Policy
Correct Answer: 2
Explanation
A Scripted REST API allows developers to expose custom REST endpoints from ServiceNow. Developers can define resources, HTTP methods, request processing, authentication requirements, and response handling. Server-side scripts can process incoming requests and return structured responses, often in JSON format. This makes Scripted REST APIs useful for integrations where external applications need to interact with custom ServiceNow functionality. UI Policies, Client Scripts, and Data Policies serve different purposes and are not designed to expose REST endpoints. Developers should also consider authentication, authorization, validation, and error handling when designing custom REST services.
Question 213
Which option is used to package configuration changes so they can be transferred between ServiceNow instances?
- Import Set
- Update Set
- Transform Map
- Data Policy
Correct Answer: 2
Explanation
Update Sets are commonly used to capture configuration changes and move those changes between ServiceNow instances. They are useful in development environments where changes need to be promoted from development to testing and eventually to production. An Update Set can capture many configuration records, such as Business Rules, Client Scripts, UI Policies, and other application components. Import Sets are used for bringing data into ServiceNow, while Transform Maps control how imported data is processed. Data Policies enforce data requirements. Developers should review Update Sets carefully before transferring or committing them.
Question 214
Which ServiceNow API is used to retrieve aggregate information such as record counts?
- GlideForm
- GlideAjax
- GlideAggregate
- GlideElement
Correct Answer: 3
Explanation
GlideAggregate is used to perform aggregate database queries, including counts, sums, averages, minimums, and maximums. It can also support grouping results by fields. For example, a developer could use GlideAggregate to count incidents grouped by priority rather than retrieving every incident and calculating the count manually. This can be more efficient for reporting-style server-side operations. GlideForm is used for client-side form manipulation, GlideAjax supports client-to-server communication, and GlideElement represents a field element. Choosing GlideAggregate for summary queries can reduce unnecessary record processing and improve the efficiency of server-side scripts.
Question 215
Which Client Script type can prevent a form from being submitted when a validation condition is not met?
- onLoad
- onChange
- onSubmit
- onCellEdit
Correct Answer: 3
Explanation
An onSubmit Client Script executes when the user attempts to submit a form. It can perform client-side validation and return false when a requirement is not satisfied, preventing the form from being submitted. For example, an onSubmit script could verify that related information has been entered before allowing the record to save. onLoad runs when the form opens, while onChange runs when a specified field changes. Client-side validation improves the user experience, but it should not be considered a security mechanism. Important security and data-integrity requirements should also be enforced server-side.
Question 216
What is the primary purpose of a Data Policy?
- To enforce data requirements across records
- To create navigation modules
- To send email notifications
- To define REST endpoints
Correct Answer: 1
Explanation
A Data Policy is used to enforce data requirements for records and fields. Depending on its configuration, it can make fields mandatory or enforce other data-related rules, including in contexts beyond the standard user interface. This makes Data Policies useful when a requirement should apply consistently to data entering the platform rather than only to a particular form. UI Policies are primarily concerned with client-side form behavior. Notifications send messages, modules provide navigation, and Scripted REST APIs expose custom web services. Data Policies can therefore help maintain data quality and consistency across different methods of entering information.
Question 217
Which object represents the current record in a Business Rule?
- previous
- current
- g_form
- gs_form
Correct Answer: 2
Explanation
The current object represents the record that caused a Business Rule to execute. Developers can use current to access field values and, where appropriate, modify the record during server-side processing. The previous object provides access to values from the previous version of a record in applicable contexts. g_form is the GlideForm object used by client-side scripts, while gs_form is not the standard object for representing a Business Rule’s current record. Understanding current and previous is important when implementing Business Rules that need to compare old and new values or perform actions based on record changes.
Question 218
Which feature allows developers to create a user-friendly interface for creating records in a target table through the Service Catalog?
- Record Producer
- UI Macro
- Business Rule
- Scheduled Script Execution
Correct Answer: 1
Explanation
A Record Producer allows users to create records in a target table through a Service Catalog-style interface. Instead of navigating directly to the underlying table form, the user fills out a simplified catalog form containing variables. Those variables can then be mapped to fields on the target record. Record Producers are useful for creating incidents, requests, cases, or other supported records through a streamlined user experience. Business Rules handle server-side processing, UI Macros provide reusable interface elements, and Scheduled Script Executions perform background processing. Record Producers are particularly useful when organizations want to simplify record creation for less technical users.
Question 219
Which method is used to save a newly created GlideRecord to the database?
- insert()
- update()
- saveRecord()
- commitRecord()
Correct Answer: 1
Explanation
The insert() method saves a newly created GlideRecord as a new database record. A developer typically creates a GlideRecord object for the desired table, calls initialize(), assigns values to fields, and then calls insert(). The method creates the record and returns its sys_id when successful. The update() method is normally used to save modifications to an existing record. saveRecord() and commitRecord() are not standard GlideRecord methods for creating records. Developers should verify required fields and business logic before inserting records to maintain data quality.
Question 220
Which feature controls the modules and navigation options displayed within an application menu?
- ACL
- Application Menu
- Transform Map
- Script Include
Correct Answer: 2
Explanation
An Application Menu organizes related modules and provides navigation options for an application. Modules can point users to lists, forms, reports, dashboards, or other application functionality. Access to modules can also be controlled through roles when required. ACLs handle data security, Transform Maps handle imported data transformation, and Script Includes store reusable server-side logic. Application menus are therefore an important part of the user experience because they provide an organized way for users to access application functionality. Developers should design navigation logically so that users can quickly locate the features relevant to their roles and responsibilities.