Advanced reference qualifier for record producer

Misgana
Tera Guru

I created a system property and script include to use as a reference qualifier, it is working on the platform side but when I use the same reference qualifier for the record producer as an advanced reference qualifier it doesn't work.

 This is the reference qualifier am using for the record producer to fetch it from the script include:

                                 javascript:new reference_qualifier().company_code();

9 REPLIES 9

Kieran Anson
Kilo Patron

Can you attach the script include code please. Can you also advise on the variable setup (i.e what table) is the reference variable pointing to

Hello @Kieran Anson 

here is the script include code

var reference_qualifier = Class.create();
reference_qualifier.prototype = {
    company_code: function() {
        var arrayUtil = new global.ArrayUtil();
        var arr = [];
        var x = [];
        var rec = new GlideRecord('sys_properties');
        rec.addQuery('name', 'sn_customerservice.stp_company');
        rec.query();
        if (rec.next()) {
            var yourPropertyValue = rec.value;
            var code = yourPropertyValue.split(',');
            for (var i = 0; i < code.length; i++) {
                var value = code[i];
                x.push(value);
            }
            var strQuery = arrayUtil.unique(x);
            return "u_company_codeIN" + strQuery;
        }
    },

    type: 'reference_qualifier'
};

Am trying to get the comma separated values from system properties and use those as a reference qualifier for company table.

N.B. The script include works as expected in the platform side with the reference qualifier below:

 javascript:new reference_qualifier().company_code();

I don't think you need the script include, from judgement you could just do:

javascript: 'u_company_codeIN' + gs.getProperty('sn_customerservice.stp_company' , '');

Hello @Kieran Anson,

Thank you for the response but the script 

javascript: 'u_company_codeIN' + gs.getProperty('sn_customerservice.stp_company' , '');

doesn't get the values form the system properties which are in a comma separated format.