- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 12:17 AM - edited 07-26-2023 12:19 AM
How Can I use onChange Client Script to set Assignment Group based on Application Support Group
I would appreciate any help/guidance on how to achieve this, using a simple onChange Client Script please.
On my standard 'Incident' form, I have a custom field called Application Name (u_application_name) which is a Reference field to the standard Applications table. Each Application has an associated 'Support Group' assigned.
I would like the standard 'Assignment Group' (assignment_group) field on my Incident form, to be auto populated with the Support Group that is associated with the Application (u_application_name) eg. u_application_name.support_group
So when the 'Application' changes, the 'Assignment Group' value needs to change and always be based on the Support Group associated with the Application.
Please kindly help me with the Script to use in the onChange.
Please see attached screenshot - this is what I am trying but this script is not working - perhaps because Application Name and Assignment Group are both Reference fields, I am not sure where my script is wrong ?
Many thanks. Here is the script I am using:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Set Assignment Group for Applications based on Application Support Group
g_form.getValue('u_application_name');
g_form.setValue('assignment_group', 'u_application_name.support_group');
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 12:25 AM
Hello @WazzaJC
Write onchange client script on application name field and script as :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Set Assignment Group for Applications based on Application Support Group
g_form.getReference('u_application_name' , function(response){
g_form.setValue('assignment_group' , response.support_group);
});
}
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 12:25 AM
Hello @WazzaJC
Write onchange client script on application name field and script as :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Set Assignment Group for Applications based on Application Support Group
g_form.getReference('u_application_name' , function(response){
g_form.setValue('assignment_group' , response.support_group);
});
}
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 12:32 AM
Hi Ahmmed,
This is excellent, works perfectly for me, I have it all up and running now! 🙂
Thanks very much and I greatly appreciate the quick response, much appreciated kind sir.
