<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Help With GlideAjax Reference Qualifier Syntax in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455520#M1241688</link>
    <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/308112"&gt;@anfield&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;reference qualifiers are applied at server side i.e. dictionary or at variable config.&lt;/P&gt;
&lt;P&gt;they can't be applied from client script&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;No client script required&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html" target="_blank" rel="noopener"&gt;Reference qualifiers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your field's dictionary use advanced ref qualifier as this&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;javascript&amp;amp;colon; new getResolutionCodes().getResolutionCodes1(current.work_order_type);&lt;/LI-CODE&gt;
&lt;P&gt;Update Script Include as this: I changed the function name so that it's not same as script include name&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var getResolutionCodes = Class.create();

getResolutionCodes.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {

    getResolutionCodes1: function(workOrderType) {
        var resolution_code_arr = [];
        var grc = new GlideRecord('x_nuvo_eam_resolution_code');
        grc.addEncodedQuery('u_work_order_typeLIKE' + workOrderType);
        grc.query();
        while (grc.next()) {
            var resolution_code_sysid = grc.getValue('sys_id');
            resolution_code_arr.push(resolution_code_sysid);
        }
        return 'sys_idIN' + resolution_code_arr.toString();
    },

    type: 'getResolutionCodes'
});&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Dec 2025 17:03:23 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2025-12-23T17:03:23Z</dc:date>
    <item>
      <title>Help With GlideAjax Reference Qualifier Syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455510#M1241685</link>
      <description>&lt;P&gt;I have a client script and script include which im trying to use to narrow down the results available to select from a reference field. So far i have verified it returns the correct data (an array of sysids), but when I check if it sets that data in my reference field, it has no effect. I think my reference qualifier line might be incorrect. Can someone help? (On screen my client script alert shows&amp;nbsp; - sys_idINsysid1, sysid2, sysid3 (etc) - so i think this is correct. I'm thinking I could be missing something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Client script

function onLoad() {

	var work_order_type = g_form.getValue('work_order_type');
	var resolution_code = g_form.getValue('resolution_code');

	var ga = new GlideAjax('x_nuvo_eam.getResolutionCodes');
	ga.addParam('sysparm_name', 'getResolutionCodes');
	ga.addParam('sysparm_work_order_type', work_order_type);
	ga.getXMLAnswer(GetResponse);

function GetResponse(response){
		alert(response);
		var response1 = JSON.parse(response);
		g_form.setValue('resolution_code', response1);
}

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Script include

var getResolutionCodes = Class.create();

getResolutionCodes.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {

getResolutionCodes: function(){
   
	var resolution_code_arr = [];

	var work_order_type = this.getParameter('sysparm_work_order_type');

	var grc = new GlideRecord('x_nuvo_eam_resolution_code');
	grc.addEncodedQuery('u_work_order_typeLIKE'+work_order_type);
	grc.query();

	while (grc.next()) {

		var resolution_code_sysid = grc.getValue('sys_id');	
		resolution_code_arr.push(resolution_code_sysid);
	}

   return 'sys_idIN' + resolution_code_arr.toString();
    }, 

    type: 'getResolutionCodes'
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Reference qualifier 

javascript&amp;amp;colon; 'sys_idIN' + getResolutionCodes().getResolutionCodes(current.work_order_type).join(',');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code doesnt narrow down the reference qualifier results at all. It just shows all results as normal. It should narrow it down based on the field passed.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 16:53:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455510#M1241685</guid>
      <dc:creator>anfield</dc:creator>
      <dc:date>2025-12-23T16:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help With GlideAjax Reference Qualifier Syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455518#M1241687</link>
      <description>&lt;P&gt;I think your reference qualifier should be something like this:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;javascript&amp;amp;colon;'sys_idIN'+getIDs(current.work_order_type); function getIDs(woType){var ids=getResolutionCodes.getResolutionCodes(woType).join(','); return ids;}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 17:03:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455518#M1241687</guid>
      <dc:creator>JenniferRah</dc:creator>
      <dc:date>2025-12-23T17:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help With GlideAjax Reference Qualifier Syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455520#M1241688</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/308112"&gt;@anfield&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;reference qualifiers are applied at server side i.e. dictionary or at variable config.&lt;/P&gt;
&lt;P&gt;they can't be applied from client script&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;No client script required&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html" target="_blank" rel="noopener"&gt;Reference qualifiers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your field's dictionary use advanced ref qualifier as this&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;javascript&amp;amp;colon; new getResolutionCodes().getResolutionCodes1(current.work_order_type);&lt;/LI-CODE&gt;
&lt;P&gt;Update Script Include as this: I changed the function name so that it's not same as script include name&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var getResolutionCodes = Class.create();

getResolutionCodes.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {

    getResolutionCodes1: function(workOrderType) {
        var resolution_code_arr = [];
        var grc = new GlideRecord('x_nuvo_eam_resolution_code');
        grc.addEncodedQuery('u_work_order_typeLIKE' + workOrderType);
        grc.query();
        while (grc.next()) {
            var resolution_code_sysid = grc.getValue('sys_id');
            resolution_code_arr.push(resolution_code_sysid);
        }
        return 'sys_idIN' + resolution_code_arr.toString();
    },

    type: 'getResolutionCodes'
});&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 17:03:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455520#M1241688</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-12-23T17:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help With GlideAjax Reference Qualifier Syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455522#M1241689</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/308112"&gt;@anfield&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you try this in your reference qualifier,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;javascript&amp;amp;colon; new getResolutionCodes().getResolutionCodes(current.work_order_type);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 17:04:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455522#M1241689</guid>
      <dc:creator>Hemanth M</dc:creator>
      <dc:date>2025-12-23T17:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help With GlideAjax Reference Qualifier Syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455523#M1241690</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/308112"&gt;@anfield&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;update your script include as&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var getResolutionCodes = Class.create();

getResolutionCodes.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {

    getResolutionCodes: function(wot) {

        var resolution_code_arr = [];

        var work_order_type = wot || this.getParameter('sysparm_work_order_type');

        var grc = new GlideRecord('x_nuvo_eam_resolution_code');
        grc.addEncodedQuery('u_work_order_typeLIKE' + work_order_type);
        grc.query();

        while (grc.next()) {

            var resolution_code_sysid = grc.getValue('sys_id');
            resolution_code_arr.push(resolution_code_sysid);
        }

        return 'sys_idIN' + resolution_code_arr.toString();
    },

    type: 'getResolutionCodes'
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and reference qualifier as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;javascript&amp;amp;colon;new getResolutionCodes().getResolutionCodes(current.work_order_type)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you are still facing any issue&amp;nbsp;&lt;/P&gt;&lt;P&gt;please share your requirement in detail with some screenshots&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please mark my answer as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#008000"&gt;helpful/correct&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;if it resolves your query.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Regards,&lt;BR /&gt;Chaitanya&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 17:04:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455523#M1241690</guid>
      <dc:creator>Chaitanya ILCR</dc:creator>
      <dc:date>2025-12-23T17:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help With GlideAjax Reference Qualifier Syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455536#M1241693</link>
      <description>&lt;P&gt;Hi. So ive tuned off the client script and made the updates as you suggested. Doesnt seem to have any affect. That script include is actually in another app, so the api is listed as&lt;/P&gt;&lt;P&gt;"x_nuvo_eam.getResolutionCodes"&lt;/P&gt;&lt;P&gt;script name:&amp;nbsp;getResolutionCodes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set the reference qual as you suggested, and also tried the line below. Neither has any affect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;javascript&amp;amp;colon; new x_nuvo_eam.getResolutionCodes().getResolutionCodes1(current.work_order_type);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 17:23:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455536#M1241693</guid>
      <dc:creator>anfield</dc:creator>
      <dc:date>2025-12-23T17:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help With GlideAjax Reference Qualifier Syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455547#M1241695</link>
      <description>&lt;P&gt;Cannot see the above code even firing. Added some logs at the top of the script include, nothing&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 17:41:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/help-with-glideajax-reference-qualifier-syntax/m-p/3455547#M1241695</guid>
      <dc:creator>anfield</dc:creator>
      <dc:date>2025-12-23T17:41:55Z</dc:date>
    </item>
  </channel>
</rss>

