正解:A,C,D,F
In ServiceNow, Client Scripts are used to execute JavaScript code on the client-side (browser) to control form behavior, validate data, or enhance user interaction.
Types of Client Scripts in ServiceNow:
There are four types of Client Scripts supported in ServiceNow:
onLoad (✅ Option D)
Runs when a form loads.
Used to pre-fill fields, hide/show elements, or set default values.
Example: Automatically setting the "Priority" field to High when a new incident is created.
onChange (✅ Option F)
Runs when a specific field value changes.
Used for dynamic form behavior, such as making fields mandatory based on another field's value.
Example: If "Category" is changed to "Hardware," then show the "Hardware Type" field.
onSubmit (✅ Option A)
Runs when the form is submitted.
Used for final validation before allowing submission.
Example: Preventing submission if a mandatory field is left empty.
onCellEdit (✅ Option C)
Runs when a cell value is edited inline in a list view.
Used to trigger immediate validation or updates without opening the full form.
Example: Displaying an alert when a user directly changes an incident's priority from a list view.
Why Are the Other Options Incorrect?
❌ B. onUpdate
No "onUpdate" client script type exists in ServiceNow.
"onUpdate" is relevant in Business Rules, not Client Scripts.
❌ E. onEdit
No "onEdit" client script type exists.
Similar functionality can be achieved with "onChange" or "onCellEdit" scripts.
❌ G. onSave
No "onSave" client script type exists.
"onSubmit" handles validation before saving a record.
Reference from Certified System Administrator (CSA) Documentation:
📌 ServiceNow Docs - Client Scripts
🔗 ServiceNow Client Scripts Documentation
"Client Scripts can be onLoad, onChange, onSubmit, or onCellEdit depending on when they execute." Conclusion:
✅ The correct answers are:
A . onSubmit (Runs when submitting a form)
C . onCellEdit (Runs when editing a list cell)
D . onLoad (Runs when a form loads)
F . onChange (Runs when a field value changes)