CIS-ITSM · Question #16
Which of the following catalog client script methods will modify the choice list options available to an end user on a catalog item?
The correct answer is B. onLoad. The onLoad catalog client script method is the correct trigger for dynamically modifying choice list options because it executes when the catalog item form first renders, before the user interacts with the field.
Question
Which of the following catalog client script methods will modify the choice list options available to an end user on a catalog item?
Options
- AonSubmit
- BonLoad
- ConSave
- DonLaunch
How the community answered
(26 responses)- B92% (24)
- C4% (1)
- D4% (1)
Why each option
The onLoad catalog client script method is the correct trigger for dynamically modifying choice list options because it executes when the catalog item form first renders, before the user interacts with the field.
onSubmit fires after the user submits the catalog item form, which is too late to modify the choice list options the user sees.
onLoad runs immediately when the catalog item form is loaded in the browser, allowing scripts to call methods such as g_form.addDecisionChoice() or g_form.removeDecisionChoice() to control which options are visible to the end user before any input occurs.
onSave is functionally equivalent to onSubmit in catalog client scripts and also executes at submission time, not at form load.
onLaunch is not a valid catalog client script type in ServiceNow and does not exist as an execution trigger.
Concept tested: Catalog client script onLoad method for choice list modification
Source: https://docs.servicenow.com/bundle/washingtondc-it-service-management/page/product/service-catalog-management/concept/c_CatalogClientScripts.html
Topics
Community Discussion
No community discussion yet for this question.