<?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: Giving more Running Transaction time  while save a record in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635815#M292741</link>
    <description>&lt;P&gt;I am guessing you need to add this line before first query so that you can get the corresponding company only instead of everything.&lt;/P&gt;
&lt;P&gt;gr1.addQuery('sys_id',current.vendor);&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2022 08:05:06 GMT</pubDate>
    <dc:creator>Kalaiarasan Pus</dc:creator>
    <dc:date>2022-05-04T08:05:06Z</dc:date>
    <item>
      <title>Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635811#M292737</link>
      <description>&lt;P&gt;When I save a record (Vendor risk issue), it's taking lot of time even though internet speed is good. I'm getting a&amp;nbsp;&lt;STRONG&gt;Running Transaction&lt;/STRONG&gt;&amp;nbsp;message on the top along with the time in seconds. Here i found the BR which effect the this&amp;nbsp;&lt;STRONG&gt;Running Transaction time.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Could you please let me know what needs to be done in the BR.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;After insert and update on BR on --- 'sn_vdr_risk_asmt_issue' Table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/186390iDB3102E7575C0AA6/image-size/large?v=v2&amp;amp;px=999" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/186395i33210E1A7BC1A95E/image-size/large?v=v2&amp;amp;px=999" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/186393i2260DECB015D72CE/image-size/large?v=v2&amp;amp;px=999" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 05:59:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635811#M292737</guid>
      <dc:creator>subbarayudu</dc:creator>
      <dc:date>2022-05-04T05:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635812#M292738</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="b05d9499db25b050f21f5583ca961976"&gt;@subbarayudu&lt;/SN-MENTION&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;To determine what is taking so long, start by going to System Logs&amp;gt; Transactions and see if you can identify anything running for a long time (about the time you canceled the timer.)&lt;/P&gt;
&lt;P&gt;Also,&amp;nbsp;Please navigate to Active Transactions (All Nodes) and then you could find the list of current active transactions and time taken by each.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/186386i730B06A509B54FCA/image-size/large?v=v2&amp;amp;px=999" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark my answer &lt;SPAN style="background-color: #ffff00;"&gt;correct &amp;amp; Helpful&lt;/SPAN&gt;, if Applicable.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Sandeep&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 06:05:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635812#M292738</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2022-05-04T06:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635813#M292739</link>
      <description>&lt;P&gt;I dont know what you are trying to do but whatever you are doing seems incorrect. You are querying all the company records and updating the count for each record in every update. Is that what you are trying to do?&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 06:35:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635813#M292739</guid>
      <dc:creator>Kalaiarasan Pus</dc:creator>
      <dc:date>2022-05-04T06:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635814#M292740</link>
      <description>&lt;P&gt;The field "Open Issue Count" would calculate the number of Vendor Risk Issues &lt;BR /&gt;where the Status(state) field is not in Closed Complete, Closed Incomplete, or Closed Cancelled) and populate that row count value in core-company form.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/186391i83237BBD098A5AB4/image-size/large?v=v2&amp;amp;px=999" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 07:43:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635814#M292740</guid>
      <dc:creator>subbarayudu</dc:creator>
      <dc:date>2022-05-04T07:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635815#M292741</link>
      <description>&lt;P&gt;I am guessing you need to add this line before first query so that you can get the corresponding company only instead of everything.&lt;/P&gt;
&lt;P&gt;gr1.addQuery('sys_id',current.vendor);&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 08:05:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635815#M292741</guid>
      <dc:creator>Kalaiarasan Pus</dc:creator>
      <dc:date>2022-05-04T08:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635816#M292742</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;why not make the BR as Async Insert/Update?&lt;/P&gt;
&lt;P&gt;Also check suggestion mentioned by &lt;SPAN class="ng-binding"&gt;Kalaiarasan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 08:10:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635816#M292742</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2022-05-04T08:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635817#M292743</link>
      <description>&lt;P&gt;using getRowCount in server side script is a health scan finding under performance risk category. This likely also needs to be addressed. How to use&amp;nbsp; Glide aggregate in the above script&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 11:09:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635817#M292743</guid>
      <dc:creator>subbarayudu</dc:creator>
      <dc:date>2022-05-04T11:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Giving more Running Transaction time  while save a record</title>
      <link>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635818#M292744</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;something like this&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var gr1 = new GlideRecord('core_company');
	gr1.addQuery('sys_id', current.vendor);
	gr1.query();
	while(gr1.next()){
		var vendorCount;
		var agg = new GlideAggregate('sn_vdr_risk_asmt_issue');
		agg.addAggregate('COUNT', 'vendor');
		agg.addEncodedQuery('stateNOT IN3,4,7');
		agg.query();
		while (agg.next()) {
			//do things on the results
			vendorCount = agg.getAggregate('COUNT', 'vendor');
		}
		gr1.u_open_issue_count_1 = vendorCount;
		gr1.update();
	}

})(current, previous);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 11:29:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/giving-more-running-transaction-time-while-save-a-record/m-p/1635818#M292744</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2022-05-04T11:29:14Z</dc:date>
    </item>
  </channel>
</rss>

