ServiceNow CAD Practice Test 5
Question 40
A script writes an audit record and needs a durable reference to the acting user. If the relevant gs.getUserName versus sys_id safeguard is omitted, which outcome is the MOST directly associated failure?
- Displaying a success message before verifying the write can conceal failure.
- UI hiding alone leaves alternate access paths unprotected.
- Names may change or be duplicated and are poor ownership keys.
- Treating a free-form group name as membership proof bypasses authorization.
Explanation
Correct Answer
C:Names may change or be duplicated and are poor ownership keys. Human-readable names and stable internal record identifiers serve different purposes. The corrective approach is to use the correct server identity representation for each field.
Incorrect Answers
A:Displaying a success message before verifying the write can conceal failure. This failure pattern belongs chiefly to gs.addInfoMessage user feedback; it is not the failure most directly tested in the gs.getUserName versus sys_id situation. Names may change or be duplicated and are poor ownership keys.
B:UI hiding alone leaves alternate access paths unprotected. This failure pattern belongs chiefly to Distinguish module access from record roles; it is not the failure most directly tested in the gs.getUserName versus sys_id situation. Names may change or be duplicated and are poor ownership keys.
D:Treating a free-form group name as membership proof bypasses authorization. This failure pattern belongs chiefly to gs.getUser().isMemberOf group membership; it is not the failure most directly tested in the gs.getUserName versus sys_id situation. Names may change or be duplicated and are poor ownership keys.
Question 41
A workflow displays a readable account name but stores an ownership reference. An engineer must explain the recommendation for gs.getUserName versus sys_id. Which underlying principle is the MOST accurate?
- gs.hasRole consults effective user role membership in a server-side context.
- Human-readable names and stable internal record identifiers serve different purposes.
- Role-based authorization connects user responsibilities to access rules.
- Effective group membership should come from server-side identity rather than form text.
Explanation
Correct Answer
B:Human-readable names and stable internal record identifiers serve different purposes. Therefore the implementation decision is to use gs.getUserID for identity references and a username method only for display when needed.
Incorrect Answers
A:Gs.hasRole consults effective user role membership in a server-side context. This describes the separate gs.hasRole server authorization mechanism; the present case instead requires gs.getUserName versus sys_id. Names may change or be duplicated and are poor ownership keys.
C:Role-based authorization connects user responsibilities to access rules. This describes the separate Application role assignment model mechanism; the present case instead requires gs.getUserName versus sys_id. Names may change or be duplicated and are poor ownership keys.
D:Effective group membership should come from server-side identity rather than form text. This describes the separate gs.getUser().isMemberOf group membership mechanism; the present case instead requires gs.getUserName versus sys_id. Names may change or be duplicated and are poor ownership keys.
Question 42
A development team needs to keep custom application source metadata in an external Git repository. A reviewer proposes this shortcut: Rename the app without configuring repository access and assume it starts committing automatically. Which principle BEST explains why a different solution is needed?
- Native integration capabilities vary and not all Git merge operations are supported inside Studio.
- ServiceNow source control integration manages application metadata versions through repository operations.
- Git commits preserve source revisions so reviewers can trace changes.
- App installation requires compatible dependencies and platform conditions.
Explanation
Correct Answer
B:ServiceNow source control integration manages application metadata versions through repository operations. The appropriate approach is to configure supported Studio source control integration to the approved remote repository.
Incorrect Answers
A:Native integration capabilities vary and not all Git merge operations are supported inside Studio. This is about Branch and merge limitations in platform integration, not why the proposed Link app to Git repository in Studio shortcut should be rejected. Untracked manual editing can produce undocumented deployment drift.
C:Git commits preserve source revisions so reviewers can trace changes. This is about Commit application changes to Git, not why the proposed Link app to Git repository in Studio shortcut should be rejected. Untracked manual editing can produce undocumented deployment drift.
D:App installation requires compatible dependencies and platform conditions. This is about App installation dependencies, not why the proposed Link app to Git repository in Studio shortcut should be rejected. Untracked manual editing can produce undocumented deployment drift.
Question 43
A new reservation must be rejected when a required invariant is violated. If the relevant Before Business Rule validation safeguard is omitted, which outcome is the MOST directly associated failure?
- Placing required pre-save validation only in a post-commit notification is too late.
- Synchronous wait calls or unbounded client record queries can harm performance or fail in some UIs.
- Depending on immediate async completion for form correctness creates race conditions.
- Duplicate code increases divergence and makes corrections error-prone.
Explanation
Correct Answer
A:Placing required pre-save validation only in a post-commit notification is too late. Before Business Rules act before the database operation in the applicable transaction. The corrective approach is to test before-rule conditions and ensure no unnecessary recursive updates.
Incorrect Answers
B:This failure pattern belongs chiefly to GlideAjax asynchronous client-server pattern; it is not the failure most directly tested in the Before Business Rule validation situation.
C:Depending on immediate async completion for form correctness creates race conditions. This failure pattern belongs chiefly to Async Business Rule processing; it is not the failure most directly tested in the Before Business Rule validation situation. Placing required pre-save validation only in a post-commit notification is too late.
D:Duplicate code increases divergence and makes corrections error-prone. This failure pattern belongs chiefly to Script Include utility reuse; it is not the failure most directly tested in the Before Business Rule validation situation. Placing required pre-save validation only in a post-commit notification is too late.
Question 44
A developer wants to inspect which action failed and which inputs it received. Select TWO statements that correctly combine the Flow execution logs and troubleshooting method with evidence or its governing principle.
- Review existing Workflow behavior and select an appropriate supported Flow Designer design for new automation.
- Delete flow execution records and report success without examining errors.
- Inspect the flow execution details and failing step outcomes in the permitted environment.
- Evidence identifies trigger record, step inputs, error and controlled correction.
- Extract shared logic into a subflow with typed inputs and documented outputs.
Explanation
Correct Answers
C:Inspect the flow execution details and failing step outcomes in the permitted environment. This is the intended action for Flow execution logs and troubleshooting.
D:Evidence identifies trigger record, step inputs, error and controlled correction. This is directly observable validation of the Flow execution logs and troubleshooting result.
Incorrect Answers
A:Review existing Workflow behavior and select an appropriate supported Flow Designer design for new automation. This serves the different Workflow versus Flow Designer lifecycle objective, not the selected Flow execution logs and troubleshooting plan. Execution history and logs support diagnosis beyond assuming the flow ran.
B:Delete flow execution records and report success without examining errors. This is not part of a safe or effective Flow execution logs and troubleshooting design. Without step-level evidence a missing task can be wrongly blamed on the trigger.
E:Extract shared logic into a subflow with typed inputs and documented outputs. This serves the different Reusable subflow design objective, not the selected Flow execution logs and troubleshooting plan. Execution history and logs support diagnosis beyond assuming the flow ran.
Question 45
A flow emits a named event and the listener needs context without a database-wide scan. Select TWO statements that correctly combine the Event parameters for notifications method with evidence or its governing principle.
- A test notification uses only authorized event context.
- Define an app-specific event in the event registry before raising it.
- Put administrator credentials in an event parameter and assume the queue is a private secret store.
- Call a registered event with gs.eventQueue from an appropriate server context.
- Supply documented event parameters when queuing the event and consume them safely.
Explanation
Correct Answers
A:A test notification uses only authorized event context. This is directly observable validation of the Event parameters for notifications result.
E:Supply documented event parameters when queuing the event and consume them safely. This is the intended action for Event parameters for notifications.
Incorrect Answers
B:Define an app-specific event in the event registry before raising it. This serves the different Event registry for named events objective, not the selected Event parameters for notifications plan. Event parameters can carry contextual data between the event producer and consumer.
C:Put administrator credentials in an event parameter and assume the queue is a private secret store. This is not part of a safe or effective Event parameters for notifications design. Passing secrets or unvalidated user-supplied addresses in event parameters can disclose data.
D:Call a registered event with gs.eventQueue from an appropriate server context. This serves the different gs.eventQueue dispatch from server script objective, not the selected Event parameters for notifications plan. Event parameters can carry contextual data between the event producer and consumer.
Question 46
A workflow displays a readable account name but stores an ownership reference. Select TWO statements that correctly combine the gs.getUserName versus sys_id method with evidence or its governing principle.
- Read the app-specific property through gs.getProperty with an appropriate default.
- Referential fields point to a user sys_id while logs show an appropriate readable label.
- Save a display label as if it were always a unique user sys_id.
- Check membership using an appropriate server-side GlideUser method such as gs.getUser().isMemberOf.
- Use gs.getUserID for identity references and a username method only for display when needed.
Explanation
Correct Answers
B:Referential fields point to a user sys_id while logs show an appropriate readable label. This is directly observable validation of the gs.getUserName versus sys_id result.
E:Use gs.getUserID for identity references and a username method only for display when needed. This is the intended action for gs.getUserName versus sys_id.
Incorrect Answers
A:Read the app-specific property through gs.getProperty with an appropriate default. This serves the different gs.getProperty server configuration objective, not the selected gs.getUserName versus sys_id plan. Human-readable names and stable internal record identifiers serve different purposes.
C:Save a display label as if it were always a unique user sys_id. This is not part of a safe or effective gs.getUserName versus sys_id design. Names may change or be duplicated and are poor ownership keys.
D:Check membership using an appropriate server-side GlideUser method such as gs.getUser().isMemberOf. This serves the different gs.getUser().isMemberOf group membership objective, not the selected gs.getUserName versus sys_id plan. Human-readable names and stable internal record identifiers serve different purposes.
Question 47
A cleanup job touches many records and needs safe restart semantics. Which practical correction or implementation decision is MOST directly appropriate?
- Test reruns and failure recovery with stable operation identifiers.
- Test schedule and timezone assumptions with representative dates.
- Assume the calendar schedule alone guarantees a job is never retried.
- Define and test the event name and listener configuration.
Explanation
Correct Answer
A:Test reruns and failure recovery with stable operation identifiers. The intended behavior can be checked because re-running the job produces no duplicate business side effects for the same item.
Incorrect Answers
B:Test schedule and timezone assumptions with representative dates. This could help Scheduled Script Execution timing, but it does not resolve the Scheduled job idempotent processing case. Repeating scheduled operations requires state tracking when writes are not naturally idempotent.
C:Assume the calendar schedule alone guarantees a job is never retried. This would not correct the Scheduled job idempotent processing workflow. A job without processed markers can create repeated tasks or notifications.
D:Define and test the event name and listener configuration. This could help Event registry for named events, but it does not resolve the Scheduled job idempotent processing case. Repeating scheduled operations requires state tracking when writes are not naturally idempotent.
Question 48
A form should let users select a fixed priority category with stable internal values. Select TWO statements that correctly combine the Choice field value and label method with evidence or its governing principle.
- Use every free-text spelling of approved as a distinct internal state.
- Stored choice values remain consistent across forms, reports and scripts.
- Configure an appropriate choice field with defined stored values and user-facing labels.
- Design a suitable unique key or indexed field with validated uniqueness requirements.
- Extend a suitable parent table after reviewing inheritance implications.
Explanation
Correct Answers
B:Stored choice values remain consistent across forms, reports and scripts. This is directly observable validation of the Choice field value and label result.
C:Configure an appropriate choice field with defined stored values and user-facing labels. This is the intended action for Choice field value and label.
Incorrect Answers
A:Use every free-text spelling of approved as a distinct internal state. This is not part of a safe or effective Choice field value and label design. Uncontrolled status strings cause inconsistent filtering and automation.
D:Design a suitable unique key or indexed field with validated uniqueness requirements. This serves the different Unique business identifier and indexes objective, not the selected Choice field value and label plan. Choice lists bound selectable values while presenting readable labels.
E:Extend a suitable parent table after reviewing inheritance implications. This serves the different Table extension and inherited fields objective, not the selected Choice field value and label plan. Choice lists bound selectable values while presenting readable labels.
Question 49
A low-priority expensive post-save calculation should not delay the user's response. Which approach BEST meets the requirement while respecting the system constraints?
- Use an async Business Rule where delayed processing meets the business requirement.
- Use async processing to enforce data that must be valid before a save commits.
- Encapsulate shared server logic in a scoped Script Include and call it from eligible contexts.
- Use a before Business Rule in the proper table and operation to validate or adjust current.
Explanation
Correct Answer
A:Use an async Business Rule where delayed processing meets the business requirement. Async Business Rules decouple suitable after-commit work from the interactive transaction. Verification should demonstrate that saving the record returns promptly and background work completes with logged outcomes.
Incorrect Answers
B:Use async processing to enforce data that must be valid before a save commits. This is an unsafe or ineffective shortcut for Async Business Rule processing. Depending on immediate async completion for form correctness creates race conditions.
C:Encapsulate shared server logic in a scoped Script Include and call it from eligible contexts. This primarily addresses Script Include utility reuse, not the specific Async Business Rule processing decision. Here, async Business Rules decouple suitable after-commit work from the interactive transaction.
D:Use a before Business Rule in the proper table and operation to validate or adjust current. This primarily addresses Before Business Rule validation, not the specific Async Business Rule processing decision. Here, async Business Rules decouple suitable after-commit work from the interactive transaction.
Question 50
A developer needs to bring reviewed repository changes into a ServiceNow development instance. If the relevant Retrieve upstream source changes safeguard is omitted, which outcome is the MOST directly associated failure?
- Pulling without checking local changes may overwrite or conflict with active development.
- Changes left uncommitted can be missing from the agreed repository version.
- Blanket all-file access undermines separation of duties.
- Untracked manual editing can produce undocumented deployment drift.
Explanation
Correct Answer
A:Pulling without checking local changes may overwrite or conflict with active development. Repository synchronization requires explicit review of remote and local state. The corrective approach is to compare branch and revision references before updating instance metadata.
Incorrect Answers
B:Changes left uncommitted can be missing from the agreed repository version. This failure pattern belongs chiefly to Commit application changes to Git; it is not the failure most directly tested in the Retrieve upstream source changes situation. Pulling without checking local changes may overwrite or conflict with active development.
C:Blanket all-file access undermines separation of duties. This failure pattern belongs chiefly to File-type-specific delegated permissions; it is not the failure most directly tested in the Retrieve upstream source changes situation. Pulling without checking local changes may overwrite or conflict with active development.
D:Untracked manual editing can produce undocumented deployment drift. This failure pattern belongs chiefly to Link app to Git repository in Studio; it is not the failure most directly tested in the Retrieve upstream source changes situation. Pulling without checking local changes may overwrite or conflict with active development.