- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 01:08 AM
I have a requirement where when after the case is created and then the assigned to is assigned or is changed then there should be a message or a pop-up to change the service, category & sub-category if needed. How can this be done?
Thanks in advance!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 01:06 AM
I have created an on change client script like below and it worked.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var assignmentgroup = g_form.getValue('assignment_group');
if (assignmentgroup == 'sys_id of the group') {
g_form.showErrorBox('field_name', 'message');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 07:15 AM
Can you explain which script is this?
I have seen this for the 1st time.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 02:48 AM
Hello @Vaishali 11
Try this script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var allowedGroups = ['sys_id_of_group1', 'sys_id_of_group2', 'sys_id_of_group3']; // Replace with actual sys_ids
var assignmentGroup = g_form.getValue('assignment_group');
if (assignmentGroup && allowedGroups.indexOf(assignmentGroup) >= 0) {
if (oldValue && oldValue !== newValue) {
var message = "Do you need to update the Service, Category, or Sub-Category?";
var proceed = confirm(message);
if (proceed) {
g_form.getControl('hr_service').focus();
}
}
}
}
The script ensures that the confirmation message popup appears only if the selected assignment group is in the predefined list of allowed groups.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 07:16 AM
Seems your answer doesn't relate to the question asked.
Please verify the same.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 02:00 AM
Hi @Juhi Poddar i tried this script but it's not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 07:16 AM
what script did you start with and where are you stuck?
This is an easy requirement.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader