<?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: filter condition on reference field in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822331#M479257</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can use the reference qualifier to get the filtered data on reference field.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=6V1Vf-pk1wc"&gt;https://www.youtube.com/watch?v=6V1Vf-pk1wc&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html"&gt;https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Mark it correct and helpful.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhagyashri Sorte.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2020 13:34:04 GMT</pubDate>
    <dc:creator>Bhagyashri Sort</dc:creator>
    <dc:date>2020-08-13T13:34:04Z</dc:date>
    <item>
      <title>filter condition on reference field</title>
      <link>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822328#M479254</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I need to display values in 'requested for' field on ritm table based on some conditions.&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;My instance setup:&lt;/SPAN&gt;&lt;BR /&gt;1. I am working on a domain separated instance.&lt;/P&gt;
&lt;P&gt;2. 3 domains are there (d1,d2,d3)&lt;/P&gt;
&lt;P&gt;3. I am an itil user in domain d1 but i have visibility in d2 because of some roles. So i can see the ritms for d2 as well.&lt;/P&gt;
&lt;P&gt;4. Currently requested for is displaying users for d2 because of following script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;reference qualifier on requested for:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; javascript:new GetRequestors().getrequestorsRITM(current)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;script in script include called above:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;query = 'active=true^sys_domain='+current.sys_domain;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return query.toString();&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;My requirement&lt;/SPAN&gt;:&lt;/P&gt;
&lt;P&gt;i need to display users from d1 domain as well but the lookup should not display values together onclicking the lookup option of ref field.&lt;/P&gt;
&lt;P&gt;That is, d1 users should only be visible when user gives filter..&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/47923iB1A3CC4714BAF759/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/47923iB1A3CC4714BAF759/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;is this feasible? Can this be achieved?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 06:29:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822328#M479254</guid>
      <dc:creator>Rj27</dc:creator>
      <dc:date>2020-08-13T06:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: filter condition on reference field</title>
      <link>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822329#M479255</link>
      <description>&lt;P&gt;Hi, perhaps an underpinning refqualifier that returns all the required data from both domains, and then a default list filter set to show results where Company IS D2. You can then change this default filter to Company IS DI on the fly, or remove it to see all results from the refqual.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 08:24:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822329#M479255</guid>
      <dc:creator>Tony Chatfield1</dc:creator>
      <dc:date>2020-08-13T08:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: filter condition on reference field</title>
      <link>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822330#M479256</link>
      <description>&lt;P&gt;Hi Tony,&lt;/P&gt;
&lt;P&gt;Thanks for the response!&lt;/P&gt;
&lt;P&gt;Can you please elaborate on what does underpinning a reference qualifier mean?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 10:26:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822330#M479256</guid>
      <dc:creator>Rj27</dc:creator>
      <dc:date>2020-08-13T10:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: filter condition on reference field</title>
      <link>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822331#M479257</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can use the reference qualifier to get the filtered data on reference field.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=6V1Vf-pk1wc"&gt;https://www.youtube.com/watch?v=6V1Vf-pk1wc&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html"&gt;https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Mark it correct and helpful.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhagyashri Sorte.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 13:34:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822331#M479257</guid>
      <dc:creator>Bhagyashri Sort</dc:creator>
      <dc:date>2020-08-13T13:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: filter condition on reference field</title>
      <link>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822332#M479258</link>
      <description>&lt;P&gt;Hi, the reference qualifier you applied to the list would need to return all possible record results, then you would set a default filter to show only a subset of the refquals data.&lt;BR /&gt; IE refqual returns records for D1 and D2, the default list filter then shows only D2 results, but you can manaully change the filter to show D1 results or both D1 and D2 results. Regardless of changes to the default filter users will never see data that was not returned by the original (underpinning) reference qualifier (D1 and D2).&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 20:28:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822332#M479258</guid>
      <dc:creator>Tony Chatfield1</dc:creator>
      <dc:date>2020-08-13T20:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: filter condition on reference field</title>
      <link>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822333#M479259</link>
      <description>&lt;P&gt;Hi Tony,&lt;/P&gt;
&lt;P&gt;Thanks for the clarification.&lt;BR /&gt;But it seems if i define both default filter and reference qualifier, the script calling from ref qualifier (which is returning all the values) is overriding the values returning from default filter(which is returning subset of values).&lt;BR /&gt;&lt;BR /&gt;i have written following scripts.&lt;BR /&gt;1. Script include being called from ref qualifier:&lt;/P&gt;
&lt;P&gt;var user = new GlideRecord('sys_user');&lt;BR /&gt; user.get(gs.getUserID());&lt;BR /&gt; &lt;BR /&gt; var query = '';&lt;BR /&gt;query = 'active=true^sys_domain=' + current.sys_domain + '^ORsys_domain=' + user.sys_domain;&lt;BR /&gt;return query.toString();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Dynamic default filter:&lt;BR /&gt;This doesnot seem to work at all.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/47924i8A5D1AB6FECFFDC8/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/47924i8A5D1AB6FECFFDC8/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 04:59:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/filter-condition-on-reference-field/m-p/1822333#M479259</guid>
      <dc:creator>Rj27</dc:creator>
      <dc:date>2020-08-17T04:59:18Z</dc:date>
    </item>
  </channel>
</rss>

