<?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: Add filter to Edit.. related list button (m2m table relationship) in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2665408#M502457</link>
    <description>&lt;P&gt;What you need to do is alter the UI Action for the Edit... record.&amp;nbsp; Find the one for m2m then change the Script, or you can try first changing the table then doing an Insert and Stay to make a copy so that you're not changing the button for all m2m related lists.&amp;nbsp; In any event you need to add 2 uri.set lines to set a default filter on the ensuing slushbucket, and to hide it so that it can't be altered.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;uri.set('jvar_no_filter', 'true');
uri.set('sysparm_query', 'nameIN' + GlideStringUtil.join(tables) + '^sys_scope!=' + parent.sys_scope.toString());
&lt;/LI-CODE&gt;
&lt;P&gt;sysparm_query can reference any number of things - a variable that calls a Script Include, encoded query,... this one is from an Edit UI Action in my PDI.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 18:59:23 GMT</pubDate>
    <dc:creator>Brad Bowman</dc:creator>
    <dc:date>2023-09-07T18:59:23Z</dc:date>
    <item>
      <title>Add filter to Edit.. related list button (m2m table relationship)</title>
      <link>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2665346#M502451</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Intro:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am trying to add a filter for Edit.. button on a Related lists.&amp;nbsp; This Edit.. button was coming as part of the newly created m2m relationship b/w 2 tables.&amp;nbsp; Now, when I am trying to add the filter conditions via "Edit Default Filter" option in the sys_ui_control record.. it's only having very limited options. I am unable to add custom filter.&lt;/P&gt;&lt;P&gt;Also, User is able to remove this existing filter and can see all the values.&amp;nbsp; It's not even read-only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to provide the custom filter conditions for his Edit... button ?&amp;nbsp; Please leave your thoughts..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 18:08:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2665346#M502451</guid>
      <dc:creator>R_52</dc:creator>
      <dc:date>2023-09-07T18:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add filter to Edit.. related list button (m2m table relationship)</title>
      <link>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2665408#M502457</link>
      <description>&lt;P&gt;What you need to do is alter the UI Action for the Edit... record.&amp;nbsp; Find the one for m2m then change the Script, or you can try first changing the table then doing an Insert and Stay to make a copy so that you're not changing the button for all m2m related lists.&amp;nbsp; In any event you need to add 2 uri.set lines to set a default filter on the ensuing slushbucket, and to hide it so that it can't be altered.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;uri.set('jvar_no_filter', 'true');
uri.set('sysparm_query', 'nameIN' + GlideStringUtil.join(tables) + '^sys_scope!=' + parent.sys_scope.toString());
&lt;/LI-CODE&gt;
&lt;P&gt;sysparm_query can reference any number of things - a variable that calls a Script Include, encoded query,... this one is from an Edit UI Action in my PDI.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 18:59:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2665408#M502457</guid>
      <dc:creator>Brad Bowman</dc:creator>
      <dc:date>2023-09-07T18:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Add filter to Edit.. related list button (m2m table relationship)</title>
      <link>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2665976#M502513</link>
      <description>&lt;P&gt;It worked. Very much appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 09:58:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2665976#M502513</guid>
      <dc:creator>R_52</dc:creator>
      <dc:date>2023-09-08T09:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add filter to Edit.. related list button (m2m table relationship)</title>
      <link>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2666071#M502519</link>
      <description>&lt;P&gt;You are welcome!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 11:42:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2666071#M502519</guid>
      <dc:creator>Brad Bowman</dc:creator>
      <dc:date>2023-09-08T11:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add filter to Edit.. related list button (m2m table relationship)</title>
      <link>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2667650#M502616</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174062"&gt;@Brad Bowman &lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to implement similar behavior in Configurable workspace as well..&amp;nbsp; The thing is when I am trying to select the record and save it. then it is not saving the records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have came across any such issues.. please let me know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 11:21:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/2667650#M502616</guid>
      <dc:creator>R_52</dc:creator>
      <dc:date>2023-09-11T11:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add filter to Edit.. related list button (m2m table relationship)</title>
      <link>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/3034459#M527404</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar task now but in my case when I go to a change task record, in the affected CIs related list and I click on the Edit button (custom made)...I need a filter to show only those Affected CIs that are listed in the Change request as "Affected CIs" (parent of that change task) and somehow all the logic is correct but when I try to apply the filter, nothing happens.&lt;BR /&gt;&lt;BR /&gt;Can you please explain the following code?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;uri.set('sysparm_query', 'nameIN' + GlideStringUtil.join(tables) + '^sys_scope!=' + parent.sys_scope.toString());&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;If you want I can provide additional info regarding my task, maybe you have an idea.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Elena&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 08:04:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/add-filter-to-edit-related-list-button-m2m-table-relationship/m-p/3034459#M527404</guid>
      <dc:creator>Elena Spıru</dc:creator>
      <dc:date>2024-09-03T08:04:39Z</dc:date>
    </item>
  </channel>
</rss>

