Request Assignment Group dependent field on account

Supriya39
Giga Guru

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.

 

 

4 REPLIES 4

Maddysunil
Kilo Sage

@Supriya39 

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

 

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. 

 

Supriya39_0-1709795078303.pngSupriya39_1-1709795169086.png

 

Please share the screenshot of reference qualifier and script include code

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)}