View Full ServiceNow CAD Exam Dumps and Practice Test Dumps.
Question 21
Which script type is best suited for modifying a record immediately before it is saved to the database?
- Display Business Rule
- Before Business Rule
- Async Business Rule
- Scheduled Script Execution
Correct Answer: 2
Explanation
A Before Business Rule runs on the server before the current record is written to the database. It is commonly used to set or modify field values, enforce server-side logic, or make changes that should be included in the same database operation. Because the script executes before the record is saved, changes made directly to the current record do not require another update call. Display Business Rules prepare data for client-side use, while Async Business Rules execute after the database operation in the background. Scheduled Script Executions are designed for time-based processing rather than immediate record manipulation.
Question 22
Which ServiceNow API is commonly used to query and manipulate records in a table from server-side scripts?
- GlideRecord
- GlideAjax
- GlideModal
- GlideDialogWindow
Correct Answer: 1
Explanation
GlideRecord is the primary server-side API for interacting with records stored in ServiceNow tables. Developers can use it to query records, insert new records, update existing records, and delete records when appropriate. A GlideRecord object represents a table and provides methods such as addQuery(), query(), next(), insert(), update(), and deleteRecord(). GlideAjax is mainly used for asynchronous communication between client-side scripts and server-side Script Includes. GlideModal and GlideDialogWindow are associated with user interface functionality. Understanding GlideRecord is fundamental for ServiceNow application development because many server-side operations depend on database access.
Question 23
What is the primary purpose of a Script Include?
- Define database indexes
- Configure application menus
- Store reusable server-side JavaScript logic
- Control browser form submission
Correct Answer: 3
Explanation
A Script Include stores reusable server-side JavaScript that can be called from other server-side scripts or, when configured as client callable, from client-side code through GlideAjax. Script Includes help developers avoid duplicating logic across Business Rules, Script Actions, scheduled jobs, and other application components. They are especially useful for creating reusable functions and classes that implement application-specific business logic. Database indexes are configured separately, application menus are handled through modules and application navigation, and browser form submission is typically controlled through Client Scripts and UI Policies. Proper use of Script Includes improves maintainability and promotes code reuse.
Question 24
Which Client Script type executes when a form is initially loaded?
- onLoad
- onChange
- onSubmit
- onCellEdit
Correct Answer: 1
Explanation
An onLoad Client Script executes when a form is loaded in the browser. It is commonly used to initialize form behavior, set field values, make fields mandatory or read-only, or display informational messages based on the current record. An onChange Client Script runs when a specified field value changes, while an onSubmit Client Script executes when the user attempts to submit the form. onCellEdit is associated with editing records directly in list views. Client Scripts operate on the client side and should generally be used for user-interface behavior rather than security enforcement, because client-side logic can potentially be bypassed.
Question 25
What is the main purpose of an Access Control (ACL) rule?
- Create application modules
- Schedule server-side scripts
- Control access to data and operations
- Configure email templates
Correct Answer: 3
Explanation
Access Control rules determine whether a user can access a particular table, record, or field and perform an operation such as create, read, write, or delete. ACL evaluation can consider roles, conditions, and scripted logic. ACLs are an important part of ServiceNow security because they enforce access at the platform level rather than relying only on form configuration. Hiding a field with a Client Script or UI Policy does not provide equivalent security. Application modules control navigation, scheduled jobs execute code at defined times, and email templates define message content. Developers should carefully design ACLs to ensure users have only the access required for their responsibilities.
Question 26
Which API allows a client-side script to call server-side logic asynchronously?
- GlideRecord
- GlideAjax
- GlideAggregate
- GlideDateTime
Correct Answer: 2
Explanation
GlideAjax enables client-side scripts to communicate asynchronously with server-side Script Includes. A Script Include must generally be configured as client callable for this pattern. The client script creates a GlideAjax object, passes parameters, and sends the request to the server. The server-side Script Include processes the request and returns a value that can be handled by the client. This approach is useful when client-side logic needs information that should be retrieved or calculated on the server. GlideRecord is primarily server-side, GlideAggregate performs database aggregation, and GlideDateTime provides date and time functionality.
Question 27
Which configuration is used to make a field mandatory based on form conditions without writing JavaScript?
- UI Policy
- Script Include
- Transform Map
- Business Rule
Correct Answer: 1
Explanation
A UI Policy can dynamically make fields mandatory, visible, or read-only based on conditions without requiring custom JavaScript. UI Policies are evaluated on the client side and are particularly useful for straightforward form behavior. For example, a developer can configure a UI Policy that makes an approval-related field mandatory when a record enters a particular state. Business Rules execute on the server and are better suited for server-side business logic. Script Includes store reusable server-side code, while Transform Maps control how imported data is mapped into target tables. UI Policies can improve maintainability by replacing simple Client Scripts with configuration-based behavior.
Question 28
What does application scope primarily provide in ServiceNow?
- Automatic database backups
- A mechanism for isolating application resources and protecting application boundaries
- Automatic user creation
- A replacement for all ACLs
Correct Answer: 2
Explanation
Application scope helps isolate application components and resources within defined boundaries. Scoped applications can contain their own tables, scripts, modules, and other application files while controlling how those resources interact with objects outside the scope. Cross-scope access can require explicit configuration or privileges. Application scope therefore supports modular application development and helps prevent unintended interference between applications. It does not replace ACLs, create users automatically, or provide database backups. Developers should understand scope when designing reusable applications because certain APIs and resources behave differently in scoped applications compared with the global scope.
Question 29
Which ServiceNow feature is commonly used to move application configuration changes between instances?
- Notifications
- Update Sets
- UI Policies
- Data Policies
Correct Answer: 2
Explanation
Update Sets are commonly used to capture configuration changes and move them from one ServiceNow instance to another, such as from development to testing or production. They can capture many application configuration records, including Business Rules, Client Scripts, UI Policies, dictionary changes, and other supported configuration elements. Developers should review an update set before transferring it because not every type of data or configuration is automatically captured. Notifications and UI Policies serve different purposes, while Data Policies enforce data requirements. For larger application development workflows, source control and application deployment mechanisms may also be used depending on the development model.
Question 30
Which Business Rule timing is most appropriate for processing a record in the background after the database transaction?
- Before
- Display
- After
- Async
Correct Answer: 4
Explanation
An Async Business Rule runs after the database transaction and processes the logic asynchronously in the background. This can be useful for operations that do not need to delay the user’s transaction, such as sending information to another system or performing additional processing. Because asynchronous execution happens separately, developers should not use it when the current transaction must immediately depend on the result. Before Business Rules execute before the record is saved, After Business Rules execute after the database operation as part of the transaction, and Display Business Rules prepare server-side data for the client. Selecting the correct timing helps improve both correctness and performance.
Question 31
Which API is specifically designed to perform aggregate database queries such as COUNT or SUM?
- GlideAggregate
- GlideAjax
- GlideElement
- GlideUser
Correct Answer: 1
Explanation
GlideAggregate is designed for performing database aggregation operations such as COUNT, SUM, AVG, MIN, and MAX. Instead of retrieving every individual record and calculating values in JavaScript, GlideAggregate allows the database to perform the aggregation, which can be more efficient for appropriate use cases. Developers can add aggregate functions and grouping conditions to analyze table data. GlideAjax handles client-to-server communication, GlideElement represents individual fields, and GlideUser provides information about the current user. Understanding aggregation APIs is valuable when building dashboards, reporting logic, or server-side scripts that need summarized database information.
Question 32
Which feature can prevent users from entering invalid data through both forms and other data-entry methods?
- UI Actions
- Client Scripts
- Data Policies
- Application Menus
Correct Answer: 3
Explanation
Data Policies enforce data requirements at the server level and can help ensure that fields meet specified conditions even when data is entered through methods other than the standard form interface. This distinction is important because client-side controls such as UI Policies and Client Scripts primarily affect the user interface and can be bypassed by imports, integrations, or other mechanisms. Data Policies can make fields mandatory or enforce related data requirements. UI Actions create buttons or menu actions, Client Scripts control client-side behavior, and Application Menus organize navigation. Choosing server-side validation mechanisms appropriately helps maintain data quality throughout the platform.
Question 33
What is the primary purpose of a Transform Map?
- Define how imported data maps to target table fields
- Create user roles
- Control form visibility
- Schedule notifications
Correct Answer: 1
Explanation
A Transform Map defines how data from an Import Set is transformed and mapped into records in a target ServiceNow table. It can specify field mappings, transformation scripts, coalesce fields, and other rules that control how imported data is processed. Transform Maps are especially useful when importing data from external systems or files because source fields may not have the same names or formats as target fields. User roles, form visibility, and notifications are configured using different platform features. Developers should also understand coalescing because it determines whether imported data should create a new record or update an existing record.
Question 34
Which method is commonly used with GlideRecord to move through records returned by a query?
- execute()
- next()
- submit()
- iterate()
Correct Answer: 2
Explanation
The next() method is commonly used with GlideRecord to move through the records returned by a query. A typical server-side pattern creates a GlideRecord object, adds query conditions, calls query(), and then uses while (gr.next()) to process each matching record. The next() method advances the GlideRecord pointer to the next available record and returns true while another record is available. Methods such as execute(), submit(), and iterate() are not the standard GlideRecord mechanism for traversing query results. Understanding this pattern is essential for ServiceNow server-side scripting because it is frequently used when processing multiple database records.
Question 35
Which component is best suited for adding a custom button or menu item to a ServiceNow form?
- UI Action
- Business Rule
- Transform Map
- Data Policy
Correct Answer: 1
Explanation
A UI Action is used to create custom buttons, links, and menu items that allow users to perform actions from forms or lists. A UI Action can contain server-side or client-side logic depending on its configuration and can be made available under specific conditions. For example, a developer might create a button that changes a record state or launches a particular process. Business Rules handle server-side processing triggered by database operations, Transform Maps handle imported data transformations, and Data Policies enforce data requirements. UI Actions are therefore the appropriate platform feature when the requirement specifically involves adding an interactive action to the user interface.
Question 36
What is the purpose of a reference qualifier?
- To control which records are available for selection in a reference field
- To encrypt database records
- To create a new application scope
- To schedule database backups
Correct Answer: 1
Explanation
A reference qualifier controls which records are available for selection in a reference field. For example, a developer can configure a reference qualifier so that a user sees only active users, locations belonging to a particular department, or records matching another condition. Reference qualifiers can be defined using conditions or more advanced scripted logic depending on the requirement. They improve usability by reducing irrelevant choices and can also help enforce appropriate selection behavior. However, reference qualifiers should not be treated as a complete security mechanism. ACLs remain responsible for enforcing whether users are actually authorized to access the underlying records.
Question 37
Which ServiceNow mechanism is commonly used to trigger notifications through server-side application logic?
- Client Script
- Event
- UI Policy
- Dictionary Entry
Correct Answer: 2
Explanation
Events provide a mechanism for triggering notifications and other event-driven processing in ServiceNow. A server-side script can generate an event with parameters, and a notification can be configured to respond to that event. This approach separates the logic that determines when something happens from the configuration that determines how users are notified. Client Scripts and UI Policies primarily control browser-side form behavior, while Dictionary Entries define field metadata and configuration. Events are especially useful when notification conditions are more complex than simple record-based conditions or when multiple processes need to respond to the same occurrence.
Question 38
What is a key advantage of using a Script Include for common application logic?
- It automatically creates ACLs
- It eliminates all database queries
- It allows reusable code to be maintained in one place
- It replaces Business Rules completely
Correct Answer: 3
Explanation
A major advantage of Script Includes is code reuse. Developers can place commonly required server-side logic in one Script Include and call it from multiple application components. This reduces duplicated code and makes future maintenance easier because changes can be made centrally rather than in many separate scripts. Script Includes do not automatically create ACLs, eliminate database queries, or replace Business Rules. Instead, they often work together with Business Rules, Script Actions, scheduled jobs, and other server-side components. A well-designed Script Include can provide a clean application programming interface for reusable business logic while improving consistency across the application.
Question 39
Which API is commonly used to obtain information about the current user in server-side scripts?
- GlideUser
- GlideAggregate
- GlideRecordSecure
- GlideDate
Correct Answer: 1
Explanation
GlideUser provides information and functionality related to the current user in server-side scripting. Through the appropriate user-related APIs, developers can determine information such as the current user’s identity and roles and use that information when implementing application logic. This can be useful when business logic depends on the user’s context. GlideAggregate is used for database aggregation, GlideRecordSecure is used for record access while respecting security controls, and GlideDate handles date-related operations. Developers should still rely on ACLs for actual access enforcement rather than using user information alone to secure sensitive data.
Question 40
Which practice generally helps improve the performance of a GlideRecord query?
- Querying every field individually
- Using appropriate query conditions and indexed fields where applicable
- Running the query repeatedly inside nested loops without conditions
- Retrieving all records before filtering them in JavaScript
Correct Answer: 2
Explanation
Using appropriate query conditions and indexed fields can significantly improve database query performance. When a query is properly constrained, ServiceNow can retrieve only the records required for the operation instead of scanning a large number of unnecessary records. Developers should avoid retrieving huge datasets when only a small subset is needed and should carefully review queries used in loops or frequently executed Business Rules. Database indexing can further improve performance for appropriate fields and query patterns. Retrieving all records and filtering them afterward in JavaScript is generally less efficient because unnecessary data has already been transferred and processed.