Advanced reference qualifier for record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 01:47 AM
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();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 01:50 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 06:47 AM
Hello
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();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 09:52 AM
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' , '');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 11:48 PM
Hello
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.