<?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 Example that can be used to capture MRVS values, including when a record is deleted in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3426877#M5409</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":gear:"&gt;⚙️&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":keycap_2:"&gt;2️⃣&lt;/span&gt; Detecting MRVS changes to update the main form&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Now imagine you want to automatically update a “Total” field every time a row is added, removed, or modified in your MRVS.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;How can you achieve this, considering the MRVS has its own event scope?&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;The solution: use a listener to detect any changes in the main form.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Create a Catalog Client Script of type onLoad and add the following event:&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;/*&lt;BR /&gt;&lt;BR /&gt;Example that can be used to capture MRVS values, including when a record is deleted — a scenario for which there is currently no native event for row deletion.&lt;BR /&gt;&lt;BR /&gt;Example code&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GuilhermeMazie_0-1763117352437.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/482476iB7973CFB09A86ADD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuilhermeMazie_0-1763117352437.png" alt="GuilhermeMazie_0-1763117352437.png" /&gt;&lt;/span&gt;&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="GuilhermeMazie_1-1763117376646.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/482477iE837AB35AD88BE30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuilhermeMazie_1-1763117376646.png" alt="GuilhermeMazie_1-1763117376646.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;check link : &lt;A href="https://pastebin.com/4fYa8Wtj" target="_blank"&gt;https://pastebin.com/4fYa8Wtj&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GuilhermeMazie_0-1763116973591.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/482474iE77EEABB86E80FDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuilhermeMazie_0-1763116973591.png" alt="GuilhermeMazie_0-1763116973591.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; With this approach, any modification in the MRVS automatically updates the “Total” field in the main catalog form.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":warning:"&gt;⚠️&lt;/span&gt;Important: Although this solution works well in many scenarios, it is essential to validate it with the platform architect or follow the best practices established by the development.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;#ITSM#SERVICENOW&lt;/P&gt;</description>
    <pubDate>Fri, 14 Nov 2025 10:50:07 GMT</pubDate>
    <dc:creator>Guilherme Mazie</dc:creator>
    <dc:date>2025-11-14T10:50:07Z</dc:date>
    <item>
      <title>Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3426877#M5409</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":gear:"&gt;⚙️&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":keycap_2:"&gt;2️⃣&lt;/span&gt; Detecting MRVS changes to update the main form&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Now imagine you want to automatically update a “Total” field every time a row is added, removed, or modified in your MRVS.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;How can you achieve this, considering the MRVS has its own event scope?&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;The solution: use a listener to detect any changes in the main form.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Create a Catalog Client Script of type onLoad and add the following event:&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;/*&lt;BR /&gt;&lt;BR /&gt;Example that can be used to capture MRVS values, including when a record is deleted — a scenario for which there is currently no native event for row deletion.&lt;BR /&gt;&lt;BR /&gt;Example code&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GuilhermeMazie_0-1763117352437.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/482476iB7973CFB09A86ADD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuilhermeMazie_0-1763117352437.png" alt="GuilhermeMazie_0-1763117352437.png" /&gt;&lt;/span&gt;&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="GuilhermeMazie_1-1763117376646.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/482477iE837AB35AD88BE30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuilhermeMazie_1-1763117376646.png" alt="GuilhermeMazie_1-1763117376646.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;check link : &lt;A href="https://pastebin.com/4fYa8Wtj" target="_blank"&gt;https://pastebin.com/4fYa8Wtj&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GuilhermeMazie_0-1763116973591.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/482474iE77EEABB86E80FDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuilhermeMazie_0-1763116973591.png" alt="GuilhermeMazie_0-1763116973591.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; With this approach, any modification in the MRVS automatically updates the “Total” field in the main catalog form.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":warning:"&gt;⚠️&lt;/span&gt;Important: Although this solution works well in many scenarios, it is essential to validate it with the platform architect or follow the best practices established by the development.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;#ITSM#SERVICENOW&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 10:50:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3426877#M5409</guid>
      <dc:creator>Guilherme Mazie</dc:creator>
      <dc:date>2025-11-14T10:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3426919#M5410</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/157650"&gt;@Guilherme Mazie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for sharing.&lt;/P&gt;
&lt;P&gt;Could you explain why onSubmit script was used?&lt;/P&gt;
&lt;P&gt;It would be nice if you explain the scripts&lt;/P&gt;
&lt;P&gt;Will this also work in native or only in portal and in both catalog item and record producer?&lt;/P&gt;
&lt;P&gt;Also it would be nice if you share the scripts rather than the link to it, the link doesn't open up.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 11:51:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3426919#M5410</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-11-14T11:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3426958#M5411</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Yes, this approach should work for both catalog items (&lt;EM&gt;sc_req_item&lt;/EM&gt;) and record producers.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;submit&lt;/STRONG&gt; event is used to remove the event listener and prevent memory leaks. That’s why, in the &lt;STRONG&gt;onLoad&lt;/STRONG&gt;, we assign the following snippet:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;scope._refDereg = scope.$on('field.change', customListener);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This way, during submit, we can access scope._refDereg and properly unbind the listener.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;BR /&gt;****&amp;nbsp;I had to change some words in the script because the community does not allow certain words.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;It’s important to note that I cannot guarantee 100% that this won’t have any impact on other form behaviors. Still, it’s worth sharing so the community can provide feedback — and because it offers a practical way to handle scenarios such as:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Dynamically populating multiline fields&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Performing calculations when rows are added, modified, or deleted&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Reacting to updates in internal tables or MRVS&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 12:37:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3426958#M5411</guid>
      <dc:creator>Guilherme Mazie</dc:creator>
      <dc:date>2025-11-14T12:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427009#M5412</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/157650"&gt;@Guilherme Mazie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will this also work in native or only in portal?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 13:37:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427009#M5412</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-11-14T13:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427057#M5414</link>
      <description>&lt;P&gt;I only tested it on catalog items via portal, mainly because ServiceNow doesn't recommend updating variables after the requester has been sent.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 14:06:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427057#M5414</guid>
      <dc:creator>Guilherme Mazie</dc:creator>
      <dc:date>2025-11-14T14:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427090#M5415</link>
      <description>&lt;P&gt;I attached the update set XML for importing into the PDI. It contains a basic usage example.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GuilhermeMazie_0-1763130435061.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/482540i421CB579E22C49E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuilhermeMazie_0-1763130435061.png" alt="GuilhermeMazie_0-1763130435061.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 14:35:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427090#M5415</guid>
      <dc:creator>Guilherme Mazie</dc:creator>
      <dc:date>2025-11-14T14:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427105#M5416</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/157650"&gt;@Guilherme Mazie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am referring whether this logic will work if user tries to submit catalog item in service catalog view and not after the submission.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 15:01:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427105#M5416</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-11-14T15:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Example that can be used to capture MRVS values, including when a record is deleted</title>
      <link>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427112#M5417</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I attached the update set XML for importing into the PDI. It contains a basic usage example.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 15:08:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/example-that-can-be-used-to-capture-mrvs-values-including-when-a/m-p/3427112#M5417</guid>
      <dc:creator>Guilherme Mazie</dc:creator>
      <dc:date>2025-11-14T15:08:04Z</dc:date>
    </item>
  </channel>
</rss>

