Advanced reference qualifier not working in ServiceNow Workspace

shrikant Kahar1
Tera Contributor

Advanced Reference qualifier not working in ServiceNow workspace. As same functionality working as expected in Classical UI.

shrikantKahar1_0-1740804982308.png

 

 

I tried with the attribute "ref_qual_elements" but it's not working in workspace 

 

Thank in advance

Shrikant

11 REPLIES 11

Voona Rohila
Kilo Patron
Kilo Patron

Hi @shrikant Kahar1 

What is the field name of Business unit? also, can you share the logic of the departmentsName Method.

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hello @Voona Rohila ,

Business Unit field is coming from department table so field name is cmn_department.business_unit.

Based on the Business unit "departmentsName()" method will return the departments.

Logic is working as expected in classical UI. problem is with the workspace.

 

Thanks,

Shrikant

 

 

Reference qualifier works same in both classic UI and Workspace

 

So you are passing department Business unit name in department field reference qualifier?You have to pass the Business unit details in your reference qualifier to get the departments based on BU value.

 

Can you share the SI logic too?

 

javascript:new global.getdepartment().departmentsName(current.business_unit); //pass the BU Value.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hello @Voona Rohila ,

please find the SI logic

 departmentsName: function(bu) {
        var answer = "";
        if (bu != '') {
            var gr = new GlideRecord("cmn_department");
            gr.addEncodedQuery('business_unit.sys_id=' + bu);
            gr.query();
            while (gr.next()) {
                answer += gr.sys_id + ",";
            }
        }
        if (bu == '') {
            var gr2 = new GlideRecord("cmn_department");
            gr2.addEncodedQuery('nameISNOTEMPTY');
            gr2.query();
            while (gr2.next()) {
                answer += gr2.sys_id + ",";
            }
        }
        return "sys_idIN" + answer;
    },
 
Thanks
shrikant

You have to pass the BU Value from your Reference qualifier.

javascript: new global.getdepartment().departmentsName(current.business_unit); //pass the BU Value

 

Also, make sure your SI is accessible from all scopes?


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP