{"id":15614,"date":"2026-09-18T06:10:29","date_gmt":"2026-09-18T06:10:29","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=15614"},"modified":"2026-09-18T06:10:29","modified_gmt":"2026-09-18T06:10:29","slug":"servicenow-cad-practice-test-questions-and-exam-dumps-part2-q21-40","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/servicenow-cad-practice-test-questions-and-exam-dumps-part2-q21-40\/","title":{"rendered":"ServiceNow CAD Practice Test Questions and Exam Dumps Part2 Q21-40"},"content":{"rendered":"<h1><\/h1>\n<h2><b>View Full <\/b><a href=\"https:\/\/www.examlabs.com\/cad-exam-dumps\"><b>ServiceNow CAD Exam Dumps<\/b><\/a><b> and Practice Test Dumps.<\/b><\/h2>\n<p>&nbsp;<\/p>\n<h3><b>Question 21<\/b><\/h3>\n<p><b>Which script type is best suited for modifying a record immediately before it is saved to the database?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display Business Rule<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Before Business Rule<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Async Business Rule<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Scheduled Script Execution<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 22<\/b><\/h3>\n<p><b>Which ServiceNow API is commonly used to query and manipulate records in a table from server-side scripts?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideRecord<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideAjax<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideModal<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideDialogWindow<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 23<\/b><\/h3>\n<p><b>What is the primary purpose of a Script Include?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Define database indexes<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Configure application menus<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Store reusable server-side JavaScript logic<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Control browser form submission<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 24<\/b><\/h3>\n<p><b>Which Client Script type executes when a form is initially loaded?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">onLoad<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">onChange<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">onSubmit<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">onCellEdit<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 25<\/b><\/h3>\n<p><b>What is the main purpose of an Access Control (ACL) rule?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Create application modules<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Schedule server-side scripts<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Control access to data and operations<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Configure email templates<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 26<\/b><\/h3>\n<p><b>Which API allows a client-side script to call server-side logic asynchronously?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideRecord<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideAjax<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideAggregate<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideDateTime<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 27<\/b><\/h3>\n<p><b>Which configuration is used to make a field mandatory based on form conditions without writing JavaScript?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">UI Policy<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Script Include<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Transform Map<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Business Rule<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 28<\/b><\/h3>\n<p><b>What does application scope primarily provide in ServiceNow?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Automatic database backups<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A mechanism for isolating application resources and protecting application boundaries<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Automatic user creation<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A replacement for all ACLs<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 29<\/b><\/h3>\n<p><b>Which ServiceNow feature is commonly used to move application configuration changes between instances?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Notifications<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Update Sets<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">UI Policies<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Data Policies<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 30<\/b><\/h3>\n<p><b>Which Business Rule timing is most appropriate for processing a record in the background after the database transaction?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Before<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Display<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">After<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Async<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 4<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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&#8217;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.<\/span><\/p>\n<h3><b>Question 31<\/b><\/h3>\n<p><b>Which API is specifically designed to perform aggregate database queries such as COUNT or SUM?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideAggregate<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideAjax<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideElement<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideUser<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 32<\/b><\/h3>\n<p><b>Which feature can prevent users from entering invalid data through both forms and other data-entry methods?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">UI Actions<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Client Scripts<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Data Policies<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Application Menus<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 33<\/b><\/h3>\n<p><b>What is the primary purpose of a Transform Map?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Define how imported data maps to target table fields<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Create user roles<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Control form visibility<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Schedule notifications<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 34<\/b><\/h3>\n<p><b>Which method is commonly used with GlideRecord to move through records returned by a query?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">execute()<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">next()<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">submit()<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">iterate()<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 35<\/b><\/h3>\n<p><b>Which component is best suited for adding a custom button or menu item to a ServiceNow form?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">UI Action<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Business Rule<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Transform Map<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Data Policy<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 36<\/b><\/h3>\n<p><b>What is the purpose of a reference qualifier?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To control which records are available for selection in a reference field<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To encrypt database records<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To create a new application scope<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To schedule database backups<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 37<\/b><\/h3>\n<p><b>Which ServiceNow mechanism is commonly used to trigger notifications through server-side application logic?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Client Script<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Event<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">UI Policy<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Dictionary Entry<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 38<\/b><\/h3>\n<p><b>What is a key advantage of using a Script Include for common application logic?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It automatically creates ACLs<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It eliminates all database queries<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It allows reusable code to be maintained in one place<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It replaces Business Rules completely<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<h3><b>Question 39<\/b><\/h3>\n<p><b>Which API is commonly used to obtain information about the current user in server-side scripts?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideUser<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideAggregate<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideRecordSecure<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GlideDate<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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&#8217;s identity and roles and use that information when implementing application logic. This can be useful when business logic depends on the user&#8217;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.<\/span><\/p>\n<h3><b>Question 40<\/b><\/h3>\n<p><b>Which practice generally helps improve the performance of a GlideRecord query?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Querying every field individually<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Using appropriate query conditions and indexed fields where applicable<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Running the query repeatedly inside nested loops without conditions<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Retrieving all records before filtering them in JavaScript<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<h3><b>Explanation<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>View Full ServiceNow CAD Exam Dumps and Practice Test Dumps. &nbsp; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1648,1647],"tags":[],"_links":{"self":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/15614"}],"collection":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/comments?post=15614"}],"version-history":[{"count":1,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/15614\/revisions"}],"predecessor-version":[{"id":15652,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/15614\/revisions\/15652"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=15614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=15614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=15614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}