- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 06:09 AM - edited 03-20-2023 06:54 AM
Hi,
I have a client script + script include in place that auto populates the assignment group based on the "managed by group" field of the business application field on the incident form.
Client script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading)
return;
if (newValue == oldValue) {
return;
}
var businessAppId = g_form.getValue('u_business_application'); // Get the ID of the business application
//Call script include
var ga = new GlideAjax('DVTIncidentUtils'); // Script Include
ga.addParam('sysparm_name', 'businessAppManagedByGroup'); // Function
ga.addParam('sysparm_appId', businessAppId); // Parameters
ga.getXMLAnswer(getResponse);
}
function getResponse(response) {
if (response) {
g_form.setValue('assignment_group', response);
} else {
g_form.addErrorMessage(getMessage("An assignment group was not found"), 'info', false);
}
}
So when the Business application is chosen on the incident form, this client script will take the "managed by group" field value of the business application, and auto populates the assignment group of the incident form.
I'd like to know: how do I create a UI button on the incident form that does exactly this? I'd like to have a button instead of this client script, because the button will give the user a choice whether they want to escalate (to the "managed by group" group) or not.
It should work like this: when a business application is chosen, the assignment group remains as is. When the "escalate" button has been pressed, then the assignment group gets populated based on the managed by group of the business application.
How do I go about creating this? Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 06:48 AM
Hi @JordyZ ,
Refer to the link below to see how to execute both Server side code and client side code in UI ACTION
https://servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
Regards,
Teja
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 06:48 AM
Hi @JordyZ ,
Refer to the link below to see how to execute both Server side code and client side code in UI ACTION
https://servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
Regards,
Teja
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 07:14 AM
Thanks @Teja11 , exactly what I needed.