Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Reference qualifier not working as expected

Yasin Shaik11
Tera Contributor

Hi All,

 

Need help for the below. 

 

In custom table we have a company and department reference fields. Here whenever user selects the company like for example user select the company of ACME Japan then I want to show Department records which are associated with the company of the ACME Japan company those departments like HR and IT and customer support. For that I have implemented a Advanced reference qualifier on Department field as follows. But this is not working as expected.  and also, whenever i save the dictionary record of Department field immediately advanced option gets removed and shows only simple qualifier and when i change it to advanced then i can be able to see the script which i have mentioned as below. is this normal behavior? Please confirm. 

 

Use reference qualifier : Advanced. 
 

 

Reference qual : Javascript:new DepartmentValues().FilterDepartment(current.company);

 

 

FilterDepartmentfunction(currentRecord) {

        gs.log('DEP001'+currentRecord); // name

        var company = currentRecord.name; 

        var DepartmentGr = new GlideRecord('cmn_department');
        DepartmentGr.addQuery('company', company);
        DepartmentGr.query();

        var departmentLIst = [];

        while (DepartmentGr.next()) {

            departmentLIst.push(DepartmentGr.name);

        }

        var departmentFilter = departmentLIst.join(',');

        return departmentFilter;

        gs.log('DEP002' + departmentFilter);


    },



8 REPLIES 8

Danish Bhairag2
Tera Sage

Hi @Yasin Shaik11 ,

 

You can try adding in your reference qualifier something like this:

javascript:'u_company='+current.variables.u_company

 

Regards,

Danish

@Danish Bhairag2 

 

Do you mean to add in advanced reference qualifier ? 

Yes @Yasin Shaik11 . Kindly use the proper backend name of the company field.

 

Please mark my response helpful if it resolves your issue.

 

Thanks,

Danish

@Danish Bhairag2 

 

I have written a code in Department field dictionary  given below but it's not working. 

javascript:'u_administrator_company='+current.u_administrator_company;