onchange client script scenarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2025 11:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2025 11:43 AM
On change client scripts get executed when a field/variable value changes.
Few simple scenarios:
1. When assignment group is empty or changed, clear assigned to field. - for this scenario, you would be writing on change client script on assignment group field.
2. When priority is changed to P1, display an alert/popup message that warm transfer is required. - in this scenario, you would be writing an on change client script on priority field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2025 12:37 PM
Hi @jankirania
There are many use case for same:
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2025 06:02 PM
@jankirania Here are some use cases.
1. You have a "Category" field and a "Subcategory" field. When the user selects a "Category," the "Subcategory" options should be filtered to show only relevant choices.
2.You need to validate the format of a user-entered value, such as an email address, phone number, or serial number.
3. You want to show or hide fields or sections based on the value of another field.
4. When a specific field is changed, you want to automatically set the value of another field.
5. When a reference field is changed, you want to populate other fields with data from the referenced record.
6. You want to prevent a user from entering certain values in a field.