<?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: How to make &amp;lt;g:ui_reference&amp;gt; dynamic reference filter using UI Page? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-make-lt-g-ui-reference-gt-dynamic-reference-filter-using/m-p/1828779#M485705</link>
    <description>&lt;P&gt;Hi Santosh,&lt;/P&gt;
&lt;P&gt;You can achieve this as below&lt;/P&gt;
&lt;P&gt;I assume this UI action is on Incident table and you want to send current incident sys_id to UI page&lt;/P&gt;
&lt;P&gt;The UI page will display user records where it is active=false and current incident&lt;/P&gt;
&lt;P&gt;Sample UI Action:&lt;/P&gt;
&lt;P&gt;Onclick: showIncident()&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function showIncident(){

    var sysId = g_form.getUniqueValue();
    var gDialog = new GlideDialogWindow('show_Incident');
    gDialog.setSize('600','600');
    gDialog.setPreference('sysparm_sysID', sysId);
    gDialog.setTitle('Create Incident');
    gDialog.render();

}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Sample UI Page:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;HTML:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;

&amp;lt;j:set var="jvar_incident_id" value="${RP.getWindowProperties().get('sysparm_sysID')}"/&amp;gt;

&amp;lt;g:ui_reference name="incident" id="incident" table="incident" completer="AJAXTableCompleter" query="active=false^u_incident=${jvar_incident_id}"/&amp;gt;

&amp;lt;/j:jelly&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jul 2020 14:45:40 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2020-07-18T14:45:40Z</dc:date>
    <item>
      <title>How to make &lt;g:ui_reference&gt; dynamic reference filter using UI Page?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-make-lt-g-ui-reference-gt-dynamic-reference-filter-using/m-p/1828778#M485704</link>
      <description>&lt;P&gt;I have created UI page and called from UI action in incident table,&lt;/P&gt;
&lt;P&gt;&amp;lt;g:ui_reference name="parent_id" id="parent_id" table="sys_user" query="active=false"/&amp;gt;&lt;/P&gt;
&lt;P&gt;I want to filter the reference list with ('active=false^u_incident=' + sys_id),&lt;/P&gt;
&lt;P&gt;Can anybody suggest me how can I achieve this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 13:36:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-make-lt-g-ui-reference-gt-dynamic-reference-filter-using/m-p/1828778#M485704</guid>
      <dc:creator>Santosh Kallim1</dc:creator>
      <dc:date>2020-07-18T13:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to make &lt;g:ui_reference&gt; dynamic reference filter using UI Page?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-make-lt-g-ui-reference-gt-dynamic-reference-filter-using/m-p/1828779#M485705</link>
      <description>&lt;P&gt;Hi Santosh,&lt;/P&gt;
&lt;P&gt;You can achieve this as below&lt;/P&gt;
&lt;P&gt;I assume this UI action is on Incident table and you want to send current incident sys_id to UI page&lt;/P&gt;
&lt;P&gt;The UI page will display user records where it is active=false and current incident&lt;/P&gt;
&lt;P&gt;Sample UI Action:&lt;/P&gt;
&lt;P&gt;Onclick: showIncident()&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function showIncident(){

    var sysId = g_form.getUniqueValue();
    var gDialog = new GlideDialogWindow('show_Incident');
    gDialog.setSize('600','600');
    gDialog.setPreference('sysparm_sysID', sysId);
    gDialog.setTitle('Create Incident');
    gDialog.render();

}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Sample UI Page:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;HTML:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;

&amp;lt;j:set var="jvar_incident_id" value="${RP.getWindowProperties().get('sysparm_sysID')}"/&amp;gt;

&amp;lt;g:ui_reference name="incident" id="incident" table="incident" completer="AJAXTableCompleter" query="active=false^u_incident=${jvar_incident_id}"/&amp;gt;

&amp;lt;/j:jelly&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 14:45:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-make-lt-g-ui-reference-gt-dynamic-reference-filter-using/m-p/1828779#M485705</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-07-18T14:45:40Z</dc:date>
    </item>
  </channel>
</rss>

