<?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 UI Macro to show Active Incidents and requests in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433765#M90691</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a UI Macro that will display active incidents and requests for the caller. I was able to find the below on the ServiceNow website, but this only displays the Active Incidents for the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" /&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;j:set var="jvar_n" value="show_incidents_${jvar_guid}:${ref}"/&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;g:reference_decoration id="${jvar_n}" field="${ref}" &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; onclick="showRelatedList('${ref}'); " &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; title="${gs.getMessage('Show related incidents')}" image="images/icons/tasks.gifx"/&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;// show related list &amp;nbsp; &lt;/P&gt;&lt;P&gt;function showRelatedList(reference) { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; try { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var displayValue = g_form.getDisplayBox(reference).value; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var title = 'Showing records related to: ' + displayValue; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var query = 'caller_id' + '=' + g_form.getValue(reference); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; query += '^' + 'active=true'; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var gdw = new GlideModal('show_list'); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setTitle(title); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setSize(750); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('table', 'incident_list'); &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('sysparm_query', query); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('title', 'A New Title'); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.render(); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (e) { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jslog('error showing related list'); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jslog(e); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &lt;/P&gt;&lt;P&gt;} &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;/j:jelly&amp;gt; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you in advance&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2018 14:44:53 GMT</pubDate>
    <dc:creator>josephd01</dc:creator>
    <dc:date>2018-02-09T14:44:53Z</dc:date>
    <item>
      <title>UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433765#M90691</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a UI Macro that will display active incidents and requests for the caller. I was able to find the below on the ServiceNow website, but this only displays the Active Incidents for the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" /&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;j:set var="jvar_n" value="show_incidents_${jvar_guid}:${ref}"/&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;g:reference_decoration id="${jvar_n}" field="${ref}" &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; onclick="showRelatedList('${ref}'); " &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; title="${gs.getMessage('Show related incidents')}" image="images/icons/tasks.gifx"/&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;// show related list &amp;nbsp; &lt;/P&gt;&lt;P&gt;function showRelatedList(reference) { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; try { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var displayValue = g_form.getDisplayBox(reference).value; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var title = 'Showing records related to: ' + displayValue; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var query = 'caller_id' + '=' + g_form.getValue(reference); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; query += '^' + 'active=true'; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var gdw = new GlideModal('show_list'); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setTitle(title); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setSize(750); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('table', 'incident_list'); &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('sysparm_query', query); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('title', 'A New Title'); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.render(); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (e) { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jslog('error showing related list'); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jslog(e); &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &lt;/P&gt;&lt;P&gt;} &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;lt;/j:jelly&amp;gt; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you in advance&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 14:44:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433765#M90691</guid>
      <dc:creator>josephd01</dc:creator>
      <dc:date>2018-02-09T14:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433766#M90692</link>
      <description>&lt;P&gt;Hi Joseph,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You can try below snippet by creating a new UI Macro: show_related_requests&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" /&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;j:set var="jvar_n" value="show_requests_${jvar_guid}:${ref}"/&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;g:reference_decoration id="${jvar_n}" field="${ref}" &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; onclick="showRelatedList('${ref}'); " &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; title="${gs.getMessage('Show related requests')}" image="images/icons/tasks.gifx"/&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;script&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;// show related list &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function showRelatedList(reference) { &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; try { &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var displayValue = g_form.getDisplayBox(reference).value; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var title = 'Showing records related to: ' + displayValue; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var query = 'requested_for' + '=' + g_form.getValue(reference); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; query += '^' + 'active=true'; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var gdw = new GlideModal('show_list'); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setTitle(title);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setSize(750); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('table', 'sc_request_list');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('sysparm_query', query); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.setPreference('title', 'A New Title'); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdw.render(); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (e) { &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jslog('error showing related list'); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jslog(e); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;} &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;/script&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;/j:jelly&amp;gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Once done go to Requested For field on the Request form &amp;amp; do configure dictionary &amp;amp; add below attribute&lt;/P&gt;&lt;BR /&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/159484i3E1311D8F6508866/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Feb 2018 15:36:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433766#M90692</guid>
      <dc:creator>Jaspal Singh</dc:creator>
      <dc:date>2018-02-09T15:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433767#M90693</link>
      <description>&lt;P&gt;Thank you this works., but now I have run into another issue. I want the incident and request Macro to be next to the callers name on the form, but I can only have one or the other. When I try to call both in the dictionary field it only displays the last macro called. Is there a way to display both on the same form? I am adding this to the call module as we need to know what the user has logged.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Feb 2018 13:45:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433767#M90693</guid>
      <dc:creator>josephd01</dc:creator>
      <dc:date>2018-02-12T13:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433768#M90694</link>
      <description>&lt;P&gt;Hi Joseph,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Then you need make changes in UI Macros &amp;amp; then use both incident &amp;amp; requested item table in a single macro.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Feb 2018 14:40:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433768#M90694</guid>
      <dc:creator>Jaspal Singh</dc:creator>
      <dc:date>2018-02-12T14:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433769#M90695</link>
      <description>&lt;P&gt;I am also trying to show both related incidents and requests using the same UI Macro, but can only get one or the other to display, and not both at the same time. How can I reference both tables in the same Macro and have them both display?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 16:53:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433769#M90695</guid>
      <dc:creator>Sarah Deady</dc:creator>
      <dc:date>2018-02-19T16:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433770#M90696</link>
      <description>&lt;P&gt;I'm also trying to show both requests and incidents for callers using the same UI Macro, but I cannot get them both to display, only one or the other. I can't figure out how to adjust the script to reference both tables in the same Macro. I'm currently using the following to display incidents; how can I fix this to show both?&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function showRelatedLists(reference) {
	try {
		var displayValue = g_form.getDisplayBox(reference).value;
		var title = 'Showing records related to: ' + displayValue;
		var s = reference.split('.');
		var referenceField = s[s.length - 1];
		if (referenceField == 'caller') {
			referenceField = 'caller_id';
		}
		var query = referenceField + '=' + g_form.getValue(reference);
					
		var gdw = new GlideModal('show_list');
		gdw.setTitle(title);
		gdw.setSize(750);
		gdw.setPreference('table', 'incident_list');
		gdw.setPreference('sysparm_query', query);
		gdw.setPreference('title', 'A New Title');
		gdw.render();
	} catch (e) {
		jslog('error showing related list');
		jslog(e);
	}
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 17:43:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433770#M90696</guid>
      <dc:creator>Sarah Deady</dc:creator>
      <dc:date>2018-02-23T17:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433771#M90697</link>
      <description>&lt;P&gt;To display both ACTIVE Incidents and Requests for a user on a popup, use this code below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;BR /&gt;&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;&lt;BR /&gt;&amp;lt;g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" /&amp;gt;&lt;BR /&gt;&amp;lt;j:set var="jvar_n" value="show_calls_${jvar_guid}:${ref}"/&amp;gt;&lt;BR /&gt;&amp;lt;g:reference_decoration id="${jvar_n}" field="${ref}"&lt;BR /&gt; onclick="showRelatedList('${ref}'); "&lt;BR /&gt; title="${gs.getMessage('Show related calls')}" image="images/icons/tasks.gifx" icon="icon-tree-right"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;// show related list&lt;BR /&gt;function showRelatedList(reference) {&lt;BR /&gt; try {&lt;BR /&gt; var displayValue = g_form.getDisplayBox(reference).value;&lt;BR /&gt; var title = 'Showing records related to: ' + displayValue;&lt;BR /&gt; var s = reference.split('.');&lt;BR /&gt; var referenceField = s[s.length - 1];&lt;BR /&gt; var query = referenceField + '=' + g_form.getValue(reference);&lt;BR /&gt; &lt;BR /&gt; //get user sys_id&lt;BR /&gt; var v = g_form.getValue(referenceField);&lt;BR /&gt; &lt;BR /&gt; var gdw = new GlideModal('show_list');&lt;BR /&gt; gdw.setTitle(title);&lt;BR /&gt; gdw.setSize(750);&lt;BR /&gt; gdw.setPreference('focusTrap', true);&lt;BR /&gt; gdw.setPreference('table', 'task_list');&lt;BR /&gt; gdw.setPreference('sysparm_query','active=true^ref_incident.caller_id=' + v + '^ORref_sc_request.requested_for=' + v);&lt;BR /&gt; gdw.setPreference('title', 'A New Title');&lt;BR /&gt; gdw.render();&lt;BR /&gt; } catch (e) {&lt;BR /&gt; jslog('error showing related list');&lt;BR /&gt; jslog(e);&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/j:jelly&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:23:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433771#M90697</guid>
      <dc:creator>ayman_h</dc:creator>
      <dc:date>2019-02-12T14:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: UI Macro to show Active Incidents and requests</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433772#M90698</link>
      <description>&lt;P&gt;in san diego they add a new function function decorationshow.&lt;/P&gt;
&lt;P&gt;(function() {&lt;BR /&gt; function decorationShow(element, original, changed, loading) {&lt;BR /&gt; var $refButton = $j(gel('${jvar_n}'));&lt;BR /&gt; $refButton.attr('role', 'button');&lt;BR /&gt; }&lt;BR /&gt; var n = '${jvar_n}'.replace(/./g, '');&lt;BR /&gt; var h = new GlideEventHandler('onLoad' + n, decorationShow, '${ref}');&lt;BR /&gt; g_event_handlers.push(h);&lt;BR /&gt;})();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what this function is doing?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 10:09:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-macro-to-show-active-incidents-and-requests/m-p/1433772#M90698</guid>
      <dc:creator>Ganesh90</dc:creator>
      <dc:date>2022-04-11T10:09:26Z</dc:date>
    </item>
  </channel>
</rss>

