Request Assignment Group dependent field on account
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 10:16 PM
Hi All,
We have a requirement that Assignment Group values list should show up on basis of 2 conditions:
1. Assignment Group should have the same account as current record's account.
2.Assignment Group having account as empty should show up.
To do this, for Assignment Group I have set :
Attribute -added edge_encryption_enabled=true,encode_utf8=false,ref_auto_completer=AJAXTableCompleter,ref_ac_columns=short_description
Dependent - account
So the lookup on assignment group shows list with same account as current account but I also want the list to show assignment groups with account as empty.
Appreciate the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 10:51 PM
To achieve the requirement where the Assignment Group values list should show up based on two conditions, you can customize the advance reference qualifier on the Assignment Group field.
javascript: new scriptIncludeName().functionName(current);
And on script include you can write the code:
var account = current.account; // Assuming 'account' is the field name for account on the current record
var gr = new GlideRecord('assignment_group');
gr.addQuery('account', account);
gr.addOrCondition('account', ''); // Fetch assignment groups with empty account
gr.query();
var assignmentGroupList = [];
while (gr.next()) {
assignmentGroupList.push(gr.getUniqueValue());
}
return 'sys_idIN' + assignmentGroupList.join(',');
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:06 PM
Appreciate your quick response.
Sorry but this is not working. also in Reference qualifier I have already added another script include to be called. Is there any other way to get assignment groups with same account and empty account.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:21 PM
Please share the screenshot of reference qualifier and script include code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:28 PM
Basically it is on basis on Assigned To value of the request, Assignment group should show up.
javascript:if(current.assigned_to == ""){BITgetAccessibleAssignmentGroups()} else{BITgetMemberNameV2(current.assigned_to)}