<?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: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184439#M2280</link>
    <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/14325"&gt;@triciav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;from the UI action you need to pass the department of owner and then within the UI page make the code changes as shared in the link above&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2025 03:19:43 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2025-02-21T03:19:43Z</dc:date>
    <item>
      <title>Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3182860#M2253</link>
      <description>&lt;P&gt;I am struggling with how to add an advanced reference qualifier for the UI Action "Assess" on the sn_risk_risk table.&lt;/P&gt;&lt;P&gt;When you click Assess it loads a UI Page Modal with a Popup to Select the Assessor and Approver.&lt;/P&gt;&lt;P&gt;I need to set a reference qualifier or filter on the Assessor&amp;nbsp; so that only the users that are in the same department as the Risk Owners Department are listed.&lt;/P&gt;&lt;P&gt;If someone can assist please with some direction on how to achieve this.&lt;/P&gt;&lt;P&gt;This is for Risk and creating a risk assessment. [GRC]&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="triciav_0-1739993823055.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/420655i8684FED76276E2DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="triciav_0-1739993823055.png" alt="triciav_0-1739993823055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://PDIInstancename.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=9859522b77073010c4a4b0bdbd5a9916" target="_blank"&gt;https://PDIInstancename.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=9859522b77073010c4a4b0bdbd5a9916&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 19:39:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3182860#M2253</guid>
      <dc:creator>triciav</dc:creator>
      <dc:date>2025-02-19T19:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183203#M2255</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I installed GRC module on my PDI, but still I am not able to find that UI Page.&lt;/P&gt;&lt;P&gt;Could you share HTML, Client Script and Processing script so I can copy the UI Page and look how it can be customized per your requirement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 05:41:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183203#M2255</guid>
      <dc:creator>Martin Friedel</dc:creator>
      <dc:date>2025-02-20T05:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183211#M2256</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/14325"&gt;@triciav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can use onLoad script within UI page and set the filter of that Assessor&lt;/P&gt;
&lt;P&gt;For this you need to pass the Department of Risk Owner present on form to that UI page&lt;/P&gt;
&lt;P&gt;check this link and you should be able to do that&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note: Remember if that UI page is OOB then it's a risk as you are updating an OOB component&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/store-value-in-reference-field-of-ui-page-using-client-script/m-p/1598733" target="_blank" rel="noopener"&gt; Store value in reference field of ui page using client script&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 05:56:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183211#M2256</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-02-20T05:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183925#M2267</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;Did you install the Advanced Risk IRM?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 15:58:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183925#M2267</guid>
      <dc:creator>triciav</dc:creator>
      <dc:date>2025-02-20T15:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183938#M2268</link>
      <description>&lt;P&gt;I checked the link, but can you provide an example of how to do this:&lt;/P&gt;&lt;P&gt;"For this you need to pass the Department of Risk Owner present on form to that UI page&lt;/P&gt;&lt;P&gt;check this link and you should be able to do that"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SO would that be similar to this:&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;g:evaluate var="jvar_productSysId" expression="RP.getWindowProperties().get('sysparm_product_sys_id')" /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;but the jvar_riskOwnerDeptSysId and the Expression would be get sysparm_risk.owner.department_sys_id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 16:09:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3183938#M2268</guid>
      <dc:creator>triciav</dc:creator>
      <dc:date>2025-02-20T16:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184036#M2269</link>
      <description>&lt;P&gt;Hello triciav,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for helpful suggestion. I have checked UI Action, it calls UI Page 'assign_assessor_approver_risk':&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sys ID:&amp;nbsp;a74d56eb77073010c4a4b0bdbd5a9990&lt;/LI&gt;&lt;LI&gt;link: ...service-now.com/sys_ui_page.do?sys_id=a74d56eb77073010c4a4b0bdbd5a9990&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check HTML on row 13, there is the encoded query you looking for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="refqual.JPG" style="width: 955px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/420998iCD9364AF9EF231C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="refqual.JPG" alt="refqual.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will you be able to modify it yourself or do you need help with that? Getting Owner's department needs scripting and customizing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my answer helped you, please mark it as correct and helpful, thank you &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Martin&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 17:17:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184036#M2269</guid>
      <dc:creator>Martin Friedel</dc:creator>
      <dc:date>2025-02-20T17:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184218#M2271</link>
      <description>&lt;P&gt;Hi Martin, YES please I need help with scripting that. I am not too good at Jelly and UI Page scripting.&lt;/P&gt;&lt;P&gt;That would be awesome if you have the skills to help.&lt;/P&gt;&lt;P&gt;Thank you sooooo much!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 20:33:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184218#M2271</guid>
      <dc:creator>triciav</dc:creator>
      <dc:date>2025-02-20T20:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184281#M2274</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first I have to mention best practice to customizing out-of-box records is to make a copy and deactivate OOB record. So here are steps according to the best practice:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customizing UI Action&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Open UI Action 'Assess' (Sys ID:&amp;nbsp;9859522b77073010c4a4b0bdbd5a9916)&lt;/P&gt;&lt;P&gt;2. Make a copy: Open additional action menu and click on 'Insert and Stay', it will open new record&lt;/P&gt;&lt;P&gt;3. Delete all code in Script field, paste this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function showAssessorApproverModal() {
    //Check if there is an assessment in draft state created from scope
    if (!g_scratchpad.draftAsmt) {
        (function() {
            g_form.getReference('owner', openModal);
        })();

        function openModal(owner) {
            var ownerDepartment = owner.getValue('department');

            var modal = new GlideModal('sn_risk_advanced_assign_assessor_approver_risk_custom');
            modal.setTitle(getMessage('Add Assessor and Approver'));
            modal.setPreference("department", ownerDepartment);
            modal.setBackdropStatic(true);
            modal.render();
        }
    } else {
        gsftSubmit(null, g_form.getFormElement(), 'risk_assess_adv');
    }
}


if (typeof window == 'undefined') {
    var count = new sn_risk_advanced.RiskAssessmentUtils().markAssess(new sn_risk_advanced.RiskUtilities().checkIfAsmtInDraft(current));
    if (count == 1) {
        gs.addInfoMessage(gs.getMessage("The assessment is successfully initiated. The assessors and approvers for this assessment are as specified in the risk assessment scope."));
    }
    action.setRedirectURL(current);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Save it&lt;/P&gt;&lt;P&gt;5. Open OOB UI Action&amp;nbsp;(Sys ID:&amp;nbsp;9859522b77073010c4a4b0bdbd5a9916)&lt;/P&gt;&lt;P&gt;6. Set checkbox 'Active' to false (unchecked)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customizing UI Page&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Open UI Page 'assign_assessor_approver_risk' (Sys ID: a74d56eb77073010c4a4b0bdbd5a9990)&lt;/P&gt;&lt;P&gt;2. Make a copy: Open additional action menu and click on 'Insert and Stay', it will open new record&lt;/P&gt;&lt;P&gt;3. Change value in field 'Name' to assign_assessor_approver_risk_custom&lt;/P&gt;&lt;P&gt;4. Delete all code in HTML field, paste this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&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;g:evaluate&amp;gt;
        var department = RP.getWindowProperties().department || RP.getParameterValue('department');
        var newAssessorRefQual = 'roles=sn_risk_advanced.ara_assessor^department=' +
        department +'^active=true^EQ';
    &amp;lt;/g:evaluate&amp;gt;
    &amp;lt;style&amp;gt;
        #assign_assessor_approver .required-marker {
            display: inline-block;
        }
    &amp;lt;/style&amp;gt;
    &amp;lt;div class="row"&amp;gt;
        &amp;lt;div class="form-horizontal" id="assign_assessor_approver"&amp;gt;
            &amp;lt;div class="form-group"&amp;gt;
                &amp;lt;label id="assessor_label" class="col-sm-3 col-sm-offset-1 control-label"&amp;gt;&amp;lt;span id="assessor_span" mandatory="true" class="required-marker"&amp;gt;&amp;lt;/span&amp;gt;${gs.getMessage('Assessor')}&amp;lt;/label&amp;gt;
                &amp;lt;div class="col-sm-6" aria-label="assessor"&amp;gt;
                    &amp;lt;g:ui_reference name="assessor" id="assessor" table="sys_user" field="name" query="${newAssessorRefQual}" onchange="checkMandatoryFields(this)" /&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="form-group"&amp;gt;
                &amp;lt;label id="approver_label" class="col-sm-3 col-sm-offset-1 control-label"&amp;gt;&amp;lt;span id="approver_span"&amp;gt;&amp;lt;/span&amp;gt;${gs.getMessage('Approver')}&amp;lt;/label&amp;gt;
                &amp;lt;div class="col-sm-6" aria-label="approver"&amp;gt;
                    &amp;lt;g:ui_reference name="approver" id="approver" table="sys_user" field="name" query="roles=sn_risk_advanced.ara_approver^active=true^EQ" /&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="form-group"&amp;gt;
                &amp;lt;label id="days_label" class="col-sm-3 col-sm-offset-1 control-label"&amp;gt;&amp;lt;span id="days_span" mandatory="true" class="required-marker"&amp;gt;&amp;lt;/span&amp;gt;${gs.getMessage('Days to overdue')}&amp;lt;/label&amp;gt;
                &amp;lt;div class="col-sm-6"&amp;gt;
                    &amp;lt;input aria-label="Days to overdue" id="days" name="days" type="number" min="1" value="5" class="form-control" onchange="enableSubmitButton()"&amp;gt;&amp;lt;/input&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="modal-footer"&amp;gt;
                &amp;lt;div class="row"&amp;gt;
                    &amp;lt;div class="col-sm-6 clearfix pull-right"&amp;gt;
                        &amp;lt;button class="btn btn-default" onclick="handleCancel()"&amp;gt;${gs.getMessage('Cancel')}&amp;lt;/button&amp;gt;
                        &amp;lt;button id="submit" class="btn btn-primary disabled" tabindex="-1" aria-disabled="false" onclick="handleSubmit()"&amp;gt;${gs.getMessage('Submit')}&amp;lt;/button&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/j:jelly&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should work as required, only users with the same value 'Department' as has a user selected in 'Owner' field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my answer helped you, please mark it as correct and helpful, thank you &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Martin&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 05:27:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184281#M2274</guid>
      <dc:creator>Martin Friedel</dc:creator>
      <dc:date>2025-02-21T05:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184439#M2280</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/14325"&gt;@triciav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;from the UI action you need to pass the department of owner and then within the UI page make the code changes as shared in the link above&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 03:19:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3184439#M2280</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-02-21T03:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3185064#M2288</link>
      <description>&lt;P&gt;Martin you are awesome!&lt;/P&gt;&lt;P&gt;Thank you so much this works!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 14:29:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3185064#M2288</guid>
      <dc:creator>triciav</dc:creator>
      <dc:date>2025-02-21T14:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Reference Qualifier for a Reference Field on a UI Page Modal Popup</title>
      <link>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3185155#M2291</link>
      <description>&lt;P&gt;Happy to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 15:19:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/advanced-reference-qualifier-for-a-reference-field-on-a-ui-page/m-p/3185155#M2291</guid>
      <dc:creator>Martin Friedel</dc:creator>
      <dc:date>2025-02-21T15:19:21Z</dc:date>
    </item>
  </channel>
</rss>

