<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Calling Apex method at regular interval from Lightning Component	</title>
	<atom:link href="https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/</link>
	<description>AI, Salesforce, ServiceNow &#38; Enterprise Tech Guides</description>
	<lastBuildDate>Fri, 30 Jul 2021 04:13:51 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>
		By: Mohit		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-8270</link>

		<dc:creator><![CDATA[Mohit]]></dc:creator>
		<pubDate>Fri, 30 Jul 2021 04:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-8270</guid>

					<description><![CDATA[Good article , I want to know how we can achieve this in lWC]]></description>
			<content:encoded><![CDATA[<p>Good article , I want to know how we can achieve this in lWC</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andres D.		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-6380</link>

		<dc:creator><![CDATA[Andres D.]]></dc:creator>
		<pubDate>Thu, 10 Dec 2020 19:09:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-6380</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5483&quot;&gt;Hemant Singh Rana&lt;/a&gt;.

I have the same concern, any idea on this?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5483">Hemant Singh Rana</a>.</p>
<p>I have the same concern, any idea on this?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mani		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-6279</link>

		<dc:creator><![CDATA[Mani]]></dc:creator>
		<pubDate>Thu, 24 Sep 2020 07:13:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-6279</guid>

					<description><![CDATA[Hi Jitendra,

I did come across a scenario wherein if the browser is minimized then the setInterval does freeze or there is a delay. Please let me know if there is a way to mitigate this use case.

For example on the instance of using setInterval to display timer does not work accurately such as if window is in inactive state by minimizing the window.

Appreciate your help.]]></description>
			<content:encoded><![CDATA[<p>Hi Jitendra,</p>
<p>I did come across a scenario wherein if the browser is minimized then the setInterval does freeze or there is a delay. Please let me know if there is a way to mitigate this use case.</p>
<p>For example on the instance of using setInterval to display timer does not work accurately such as if window is in inactive state by minimizing the window.</p>
<p>Appreciate your help.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: srikanth.ValluriSrikanth		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-6131</link>

		<dc:creator><![CDATA[srikanth.ValluriSrikanth]]></dc:creator>
		<pubDate>Wed, 27 May 2020 10:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-6131</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5904&quot;&gt;Jitendra&lt;/a&gt;.

Hi Jitendra,

I have used the same setinterval function to refresh the records on lighting component for every 10 seconds, but after some time *nearly after 30 minutes) the page is not responding and not able to scroll through the page. Also I can see the API limits are completed. Is this the issue with Setinterval]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5904">Jitendra</a>.</p>
<p>Hi Jitendra,</p>
<p>I have used the same setinterval function to refresh the records on lighting component for every 10 seconds, but after some time *nearly after 30 minutes) the page is not responding and not able to scroll through the page. Also I can see the API limits are completed. Is this the issue with Setinterval</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jitendra		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5904</link>

		<dc:creator><![CDATA[Jitendra]]></dc:creator>
		<pubDate>Tue, 03 Mar 2020 14:57:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-5904</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5897&quot;&gt;viviramji&lt;/a&gt;.

Platform event, Streaming API or empAPI Lightning component can be used. But they are very costly - only 50k notifications can be delivered in 24 hour. Even if its wastage of source, it does not count against any governor limit so I dont see any issue.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5897">viviramji</a>.</p>
<p>Platform event, Streaming API or empAPI Lightning component can be used. But they are very costly &#8211; only 50k notifications can be delivered in 24 hour. Even if its wastage of source, it does not count against any governor limit so I dont see any issue.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: viviramji		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5897</link>

		<dc:creator><![CDATA[viviramji]]></dc:creator>
		<pubDate>Tue, 03 Mar 2020 06:36:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-5897</guid>

					<description><![CDATA[Is there other way to solved this? I mean like Observer Patter just sent a notification to lightning component from apex method? I think a waste or resorce to listing all time new changes on backend. Thanks.]]></description>
			<content:encoded><![CDATA[<p>Is there other way to solved this? I mean like Observer Patter just sent a notification to lightning component from apex method? I think a waste or resorce to listing all time new changes on backend. Thanks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Krishna		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5746</link>

		<dc:creator><![CDATA[Krishna]]></dc:creator>
		<pubDate>Fri, 10 Jan 2020 15:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-5746</guid>

					<description><![CDATA[I woukd like to do the same but I am worried about the total page performace. Will it hamper it in some way? also, due to this the page load time increases? Please let me know.]]></description>
			<content:encoded><![CDATA[<p>I woukd like to do the same but I am worried about the total page performace. Will it hamper it in some way? also, due to this the page load time increases? Please let me know.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kalyan		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5731</link>

		<dc:creator><![CDATA[Kalyan]]></dc:creator>
		<pubDate>Sun, 05 Jan 2020 23:42:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-5731</guid>

					<description><![CDATA[Hi,

I am having a problem. Below is the code.

@AuraEnabled
    public static String calculateEstimate(String id, String sobjName){
      System.debug(&#039;sobjName::&#039;+sobjName);
      
     String endPointURL=&#039;https://pod2.sssss.com/icmx/jsp/sf/some_apis.jsp&#039;;
     String API_VERSION=&#039;15.0&#039;;
     String baseURL= URL.getSalesforceBaseUrl().toExternalForm();
     String partnerServerURL=baseURL+&#039;/services/Soap/u/&#039;+API_VERSION+&#039;/&#039;+Userinfo.getOrganizationId();
     String businessToken =&#039;7830133a9723db8c5a67c9a886418&#039;;
     String requestBody=&#039;sfSessionId=&#039;+UserInfo.getSessionId()+&#039;&#038;sfServerUrl=&#039; + String.escapeSingleQuotes(partnerServerURL) + &#039;&#038;sfDomain=&#039; + String.escapeSingleQuotes(baseURL) + &#039;&#038;BizToken=&#039;+businessToken+&#039;&#038;sfPartnerServerUrl=&#039;+partnerServerURL;
         System.debug(&#039;requestBody:&#062;&#062;&#039;+requestBody);
        // System.debug(&#039;endPointURL:&#062;&#062;&#039;+endPointURL); 
         
      HttpRequest req = new HttpRequest();
      //req.setBody(requestBody);
      req.setEndpoint(endPointURL);
      req.setMethod(&#039;post&#039;);
      Http h = new Http();
       HttpResponse res = h.send(req);
           System.debug(&#039;sobjName::&#039;+res);
            System.debug(&#039;httpResponse:&#062;&#062;&#039;+res.getBody().trim());
   
    return &#039;&#039;;
    }





Here I am trying to fetch the sessionId in the jsp that is shown. In this case I am getting the sessionId as null in the JSP. Where when I call the same code without the @auraenabled annotation and remove the static reference, it is working fine. 

May I know if there is a way of getting the sessionId in the JSP? 

Thanks for your help in advance.]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I am having a problem. Below is the code.</p>
<p>@AuraEnabled<br />
    public static String calculateEstimate(String id, String sobjName){<br />
      System.debug(&#8216;sobjName::&#8217;+sobjName);</p>
<p>     String endPointURL=&#8217;https://pod2.sssss.com/icmx/jsp/sf/some_apis.jsp&#8217;;<br />
     String API_VERSION=&#8217;15.0&#8242;;<br />
     String baseURL= URL.getSalesforceBaseUrl().toExternalForm();<br />
     String partnerServerURL=baseURL+&#8217;/services/Soap/u/&#8217;+API_VERSION+&#8217;/&#8217;+Userinfo.getOrganizationId();<br />
     String businessToken =&#8217;7830133a9723db8c5a67c9a886418&#8242;;<br />
     String requestBody=&#8217;sfSessionId=&#8217;+UserInfo.getSessionId()+&#8217;&amp;sfServerUrl=&#8217; + String.escapeSingleQuotes(partnerServerURL) + &#8216;&amp;sfDomain=&#8217; + String.escapeSingleQuotes(baseURL) + &#8216;&amp;BizToken=&#8217;+businessToken+&#8217;&amp;sfPartnerServerUrl=&#8217;+partnerServerURL;<br />
         System.debug(&#8216;requestBody:&gt;&gt;&#8217;+requestBody);<br />
        // System.debug(&#8216;endPointURL:&gt;&gt;&#8217;+endPointURL); </p>
<p>      HttpRequest req = new HttpRequest();<br />
      //req.setBody(requestBody);<br />
      req.setEndpoint(endPointURL);<br />
      req.setMethod(&#8216;post&#8217;);<br />
      Http h = new Http();<br />
       HttpResponse res = h.send(req);<br />
           System.debug(&#8216;sobjName::&#8217;+res);<br />
            System.debug(&#8216;httpResponse:&gt;&gt;&#8217;+res.getBody().trim());</p>
<p>    return &#8221;;<br />
    }</p>
<p>Here I am trying to fetch the sessionId in the jsp that is shown. In this case I am getting the sessionId as null in the JSP. Where when I call the same code without the @auraenabled annotation and remove the static reference, it is working fine. </p>
<p>May I know if there is a way of getting the sessionId in the JSP? </p>
<p>Thanks for your help in advance.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Hemant Singh Rana		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5483</link>

		<dc:creator><![CDATA[Hemant Singh Rana]]></dc:creator>
		<pubDate>Thu, 26 Sep 2019 09:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-5483</guid>

					<description><![CDATA[Thanks for this awesome approach. But I just want to understand one thing is there issue with any governor limit or any issue with performance as calling apex method every 5-10 sec will be a good approach or not. I am just thinking about this as I want to implement this functionality and need to be clear before implementing it. Thanks for you help...]]></description>
			<content:encoded><![CDATA[<p>Thanks for this awesome approach. But I just want to understand one thing is there issue with any governor limit or any issue with performance as calling apex method every 5-10 sec will be a good approach or not. I am just thinking about this as I want to implement this functionality and need to be clear before implementing it. Thanks for you help&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Murali		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5405</link>

		<dc:creator><![CDATA[Murali]]></dc:creator>
		<pubDate>Wed, 21 Aug 2019 13:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5715#comment-5405</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5018&quot;&gt;Rahul&lt;/a&gt;.

Rahul,

Could you please provide how to kill when moved to other tab. I am new to lightning and I struck there]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/salesforce/calling-apex-method-at-regular-interval-from-lightning-component/#comment-5018">Rahul</a>.</p>
<p>Rahul,</p>
<p>Could you please provide how to kill when moved to other tab. I am new to lightning and I struck there</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.jitendrazaa.com @ 2026-10-15 16:12:26 by W3 Total Cache
-->