CAD · Question #64
Which one of the following objects CANNOT be used in a Script Action script?
The correct answer is A. previous. Script Actions execute asynchronously based on an event, providing access to the current event details and associated record, but not the 'previous' object, which is tied to record updates.
Question
Which one of the following objects CANNOT be used in a Script Action script?
Options
- Aprevious
- BGlideRecord
- Cevent
- Dcurrent
How the community answered
(33 responses)- A88% (29)
- B3% (1)
- C3% (1)
- D6% (2)
Why each option
Script Actions execute asynchronously based on an event, providing access to the current event details and associated record, but not the 'previous' object, which is tied to record updates.
The `previous` object is typically available in server-side scripts like Business Rules when they execute before or after an update or delete operation on a record, providing the record's state prior to the change. Script Actions are triggered by events and do not inherently operate on record update operations in the same manner, therefore `previous` is not available.
`GlideRecord` is a fundamental server-side API that is commonly used in Script Actions to query, create, or modify database records.
The `event` object is explicitly available in Script Actions and Business Rules triggered by events, containing details about the event that fired the script.
The `current` object is available in Script Actions when the triggering event has an associated record, providing access to that record's properties.
Concept tested: Script Action script objects
Source: https://docs.servicenow.com/bundle/washingtondc-application-development/page/script/server-scripting/concept/c_ScriptActions.html
Topics
Community Discussion
No community discussion yet for this question.