Restrict assignment groups based on account on case record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 03:38 AM
Hi Team,
I need to restrict the assignment group field on case record.
If account A( 'account.u_partner_owned=true') is selected on case record it should show A assignment group.
If account B('account.u_customer_owned=true') is selected on case record it should show B assignment group.
else all the assignment group should available.
Already a refernce qualifier available the on this field as its extended from task table.
I have to make the is dictionary override.
I am trying it through script include and call that in reference qualifier but failing.
Can someone help me on this.
Thanks,
Anwar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 05:17 AM - edited 03-18-2024 05:28 AM
Hi @Anwar2 ,
In your dictionary override, check the "Override reference qualifier" and use the below code to call the script include -
"javascript: new YourScripIncludeName().YourFunctionName(current.u_partner_owned,curent.u_customer_owned);"
Use below code in your script Include -
getGroups: function(owner,owned) {
var arr = [];
if (owner == true) {
var grp = new GlideRecord('sys_user_group');
grp.addQuery('name','YourGroupName');
grp.query();
if (grp.next()) {
arr.push(grp.getValue('name'));
}
}
else if (owned == true) {
var grp = new GlideRecord('sys_user_group');
grp.addQuery('name','YourGroupName');
grp.query();
if (grp.next()) {
arr.push(grp.getValue('name'));
}
}
else {
var grp = new GlideRecord('sys_user_group');
grp.addActiveQuery();
grp.query();
while (grp.next()) {
arr.push(grp.getValue('name'));
}
}
return 'nameIN' + arr;
}