View Full ServiceNow CAD Exam Dumps and Practice Test Dumps.
Question 181
Which ServiceNow object is used to define a reusable server-side function that can be called from multiple scripts?
- UI Policy
- Script Include
- Client Script
- UI Action
Correct Answer: 2
Explanation
A Script Include is used to store reusable server-side JavaScript logic. Developers can create functions, methods, or classes inside Script Includes and call them from different server-side components. This approach reduces duplicate code and makes application logic easier to maintain. Script Includes can be used by Business Rules, Script Actions, Scheduled Script Executions, and other server-side scripts. They can also be configured as client-callable when appropriate, allowing client-side code to communicate with server-side logic through GlideAjax. UI Policies and Client Scripts primarily control client-side behavior, while UI Actions provide user interface controls.
Question 182
Which method should generally be used to save changes made to an existing GlideRecord?
- save()
- commit()
- update()
- modify()
Correct Answer: 3
Explanation
The GlideRecord update() method is used to save changes made to an existing record. After retrieving a record and modifying one or more fields, calling update() writes those changes back to the database. For example, a script can retrieve an incident, change its state, and then call update() to save the new value. The insert() method is used to create a new record, while deleteRecord() can remove an existing record. Methods such as save(), commit(), and modify() are not the standard GlideRecord method for updating a record in ServiceNow.
Question 183
Which component allows developers to create a custom REST endpoint within ServiceNow?
- Scripted REST API
- Client Script
- UI Policy
- Transform Map
Correct Answer: 1
Explanation
A Scripted REST API allows developers to create custom REST endpoints within ServiceNow. It provides control over the HTTP resources, methods, request processing, and responses exposed by the application. Developers can use server-side JavaScript to implement custom integration logic and return structured responses such as JSON. Client Scripts are used for browser-side form behavior, UI Policies control field states, and Transform Maps process imported data. Scripted REST APIs are useful when external applications need to interact with ServiceNow using a custom interface that is not fully covered by the platform’s standard REST APIs.
Question 184
What is the primary purpose of a REST Message in ServiceNow?
- To create table inheritance
- To define and send requests to an external REST service
- To control form field visibility
- To create ACL records
Correct Answer: 2
Explanation
A REST Message is used to configure and communicate with external REST web services. Developers can define an endpoint, HTTP methods, authentication settings, request parameters, headers, and other integration details. REST Messages can then be called from server-side scripts using APIs such as RESTMessageV2. This makes them useful for integrating ServiceNow with external systems. They are not designed for controlling form visibility, defining table inheritance, or creating ACLs. Proper authentication, error handling, and response processing should be considered when building REST integrations to ensure reliable and secure communication.
Question 185
Which method is commonly used to create a new record with GlideRecord?
- insert()
- create()
- newRecordSave()
- addRecord()
Correct Answer: 1
Explanation
The GlideRecord insert() method creates a new record in the specified table. A typical process involves creating a GlideRecord object, initializing or assigning field values, and then calling insert(). The method returns the sys_id of the newly created record when the insertion succeeds. update() is used to save modifications to an existing record. Developers should ensure that required fields and business rules are properly considered before inserting records. The methods create(), newRecordSave(), and addRecord() are not the standard GlideRecord methods for inserting a record into a ServiceNow table.
Question 186
Which configuration determines the fields and their order displayed on a ServiceNow form?
- Form Layout
- Business Rule
- ACL
- Transform Map
Correct Answer: 1
Explanation
Form Layout determines which fields appear on a form and the order in which those fields are displayed. Developers and administrators can use form configuration to organize fields into sections and create a more usable interface. Form Layout itself does not determine database security, execute server-side logic, or transform imported data. Business Rules handle server-side processing, ACLs control access, and Transform Maps handle data transformation during imports. For more advanced form customization, Form Designer and related UI configuration tools can also be used. A logical form layout helps users find and enter information efficiently.
Question 187
Which API can be used to make a server-side call from a Client Script without directly exposing database access to the browser?
- GlideRecord
- GlideAjax
- GlideAggregate
- GlideSystem
Correct Answer: 2
Explanation
GlideAjax enables a Client Script to communicate with a server-side Script Include. This architecture allows server-side processing or data retrieval to remain on the server rather than placing direct database operations in client-side code. The Script Include must be configured appropriately for client calls, and the client can send parameters through GlideAjax and process the response. GlideRecord is primarily a server-side database API, while GlideAggregate performs aggregate queries and GlideSystem provides server-side system functionality. GlideAjax is therefore an important mechanism for implementing controlled client-to-server communication in ServiceNow applications.
Question 188
Which feature is designed to restrict the records shown in a reference field based on conditions?
- Data Policy
- Reference Qualifier
- UI Action
- Notification
Correct Answer: 2
Explanation
A Reference Qualifier controls which records are available for selection in a reference field. It can restrict the list according to conditions, making it easier for users to select relevant records. For example, a qualifier could limit a user reference field to active users belonging to a particular department. Reference Qualifiers can be static or dynamic depending on the application’s requirements. Data Policies enforce data requirements, UI Actions provide buttons or links, and Notifications communicate information to users. Reference Qualifiers primarily improve selection and usability and should not be treated as a replacement for ACL-based security.
Question 189
Which Business Rule timing is commonly used when a developer needs to modify the current record before it is saved?
- Before
- After
- Async
- Display
Correct Answer: 1
Explanation
A Before Business Rule runs before the current record is saved to the database. It is commonly used to modify field values, enforce server-side business logic, or set calculated values on the record before the database operation occurs. Because the changes are made before the record is written, the modified values can be saved as part of the same transaction. After Business Rules execute after the record is saved, Async Business Rules process work asynchronously, and Display Business Rules execute when records are loaded for display. Choosing Before timing is appropriate when changes need to be applied directly to the current record before saving.
Question 190
Which object provides access to fields and controls on the current ServiceNow form in client-side scripts?
- GlideRecord
- GlideSystem
- GlideForm
- GlideAggregate
Correct Answer: 3
Explanation
GlideForm, represented by the g_form object, provides client-side methods for interacting with the current ServiceNow form. Developers can use it to retrieve and change field values, control field visibility, set fields as mandatory or read-only, display messages, and perform other form-level 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 browser, GlideForm is the appropriate API for modifying the current form’s behavior. It is one of the most frequently used APIs in client-side ServiceNow development.
Question 191
Which feature can be used to define mandatory, read-only, or visible field behavior based on conditions without writing custom JavaScript?
- UI Policy
- Script Include
- Scheduled Script Execution
- REST Message
Correct Answer: 1
Explanation
A UI Policy can dynamically control whether fields are mandatory, visible, or read-only based on conditions. This provides a declarative way to manage common form behavior without writing custom Client Script code. UI Policies are evaluated on the client side and can improve maintainability when the required behavior is straightforward. Script Includes store reusable server-side logic, Scheduled Script Executions run background scripts at specified times, and REST Messages support external integrations. Developers should generally prefer declarative configuration when it can satisfy the requirement because it can reduce custom code and make application behavior easier to maintain.
Question 192
Which ServiceNow feature is commonly used to run server-side JavaScript at a specified time or recurring schedule?
- UI Action
- Scheduled Script Execution
- Client Script
- UI Policy
Correct Answer: 2
Explanation
Scheduled Script Executions allow developers to run server-side JavaScript according to a defined schedule. They can be configured to execute once, periodically, or according to other scheduling requirements. They are useful for background maintenance, data processing, scheduled integrations, and automated record updates. Unlike Client Scripts and UI Policies, Scheduled Script Executions do not depend on a user opening or interacting with a form. UI Actions are user-triggered interface controls. Developers should consider transaction volume and system performance when scheduling large operations, particularly when processing significant numbers of database records.
Question 193
What does the deleteRecord() method do in GlideRecord?
- Deletes the current record
- Deletes the entire table
- Removes a field from the table
- Cancels a Business Rule
Correct Answer: 1
Explanation
The GlideRecord deleteRecord() method deletes the current record represented by the GlideRecord object. A script generally queries or retrieves a record, moves to the appropriate record using next() or get(), and then calls deleteRecord(). Because deleting records can have significant consequences, developers should ensure that the correct records are selected before executing deletion logic. The method does not delete an entire table, remove fields, or disable Business Rules. In production applications, deletion logic should be carefully controlled and tested, especially when records are related to other tables or are subject to auditing and retention requirements.
Question 194
Which ServiceNow feature is primarily responsible for controlling who can access a table or field?
- UI Policy
- Client Script
- ACL
- Form Layout
Correct Answer: 3
Explanation
An Access Control List, or ACL, controls whether users are authorized to perform specific operations on tables and fields. ACLs can govern actions such as read, write, create, and delete. They may use roles, conditions, and scripts to determine whether access should be granted. Client Scripts and UI Policies can modify what users see or interact with on forms, but they are not substitutes for security controls. Form Layout controls presentation only. ACLs should therefore be used whenever an application requirement involves protecting data or restricting user access to records and fields.
Question 195
Which Flow Designer component is intended to package reusable automation that can be called by multiple flows?
- Notification
- Subflow
- Dictionary Entry
- Form Layout
Correct Answer: 2
Explanation
A Subflow is designed to package reusable automation logic that can be invoked from multiple flows or other subflows. It can accept inputs and produce outputs, allowing developers to create modular automation components. This reduces duplication because common process steps can be maintained in one location rather than recreated in every flow. Notifications handle communication, Dictionary Entries define field metadata, and Form Layout controls form presentation. Subflows are especially useful when the same business process needs to be executed from different triggers or workflows. Reusable automation also makes changes easier because common logic can be updated centrally.
Question 196
Which method can be used to determine whether a GlideRecord query returned another record during iteration?
- next()
- insert()
- update()
- initialize()
Correct Answer: 1
Explanation
The next() method is commonly used to iterate through records returned by a GlideRecord query. It moves the GlideRecord object to the next available record and returns a Boolean result indicating whether a record was available. A typical pattern is while (gr.next()), which processes each record in the result set. insert() creates a new record, update() saves changes to an existing record, and initialize() prepares a GlideRecord object for creating a new record. Understanding next() is essential when processing multiple database records in server-side ServiceNow scripts.
Question 197
Which ServiceNow capability is commonly used to capture configuration changes and move them between instances?
- Scheduled Jobs
- Update Sets
- Notifications
- Reference Qualifiers
Correct Answer: 2
Explanation
Update Sets capture many types of configuration changes made in a ServiceNow instance and allow those changes to be transferred to another instance. They are commonly used when moving development changes from one environment to another, such as from development to test or production. Developers should review an Update Set before committing and transferring it to ensure the expected configuration records have been captured. Update Sets are not designed primarily for scheduled execution, notifications, or reference filtering. For application development, other deployment approaches such as source control or application repository mechanisms may also be used depending on the platform configuration.
Question 198
Which API is most appropriate for retrieving a count of records grouped by a field?
- GlideForm
- GlideAggregate
- GlideAjax
- GlideUser
Correct Answer: 2
Explanation
GlideAggregate is designed for aggregate database operations, including counting records and grouping results by fields. For example, a developer could use it to count incidents grouped by priority or state without retrieving every individual incident record. This can be more efficient than querying all records and manually calculating the counts in JavaScript. GlideForm is used for client-side form manipulation, GlideAjax supports client-to-server communication, and GlideUser provides information about the current user. Using GlideAggregate appropriately can improve performance when an application needs summarized database information rather than complete record data.
Question 199
Which type of Client Script runs when a user changes the value of a specified field?
- onLoad
- onSubmit
- onChange
- onDisplay
Correct Answer: 3
Explanation
An onChange Client Script executes when the value of a specified field changes on a form. It is commonly used to dynamically update other fields, display messages, perform client-side validation, or change form behavior based on the selected value. An onLoad Client Script runs when the form initially loads, while an onSubmit Client Script runs when the user attempts to submit the form. Choosing the correct Client Script type is important because each one has a different execution point. Developers should also avoid unnecessary client-side processing to maintain responsive form performance.
Question 200
Which statement correctly describes a ServiceNow application scope?
- It prevents an application from containing tables
- It provides boundaries for application artifacts and controls cross-application access
- It only affects the application’s user interface
- It automatically grants all users access to application data
Correct Answer: 2
Explanation
Application scope provides boundaries around application artifacts, logic, and data and helps control how applications interact with one another. Scoped applications can contain tables, scripts, modules, Business Rules, Script Includes, and other components. When one application needs to access resources belonging to another scope, appropriate cross-scope permissions or privileges may be required. Scope is therefore important for reducing unintended interference between applications and establishing clear ownership of application components. It does not prevent applications from having tables, only affect the user interface, or automatically grant users access to application data. Security is separately managed through roles, ACLs, and other controls.