<?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 for Tech Vision &#8211; Salesforce Best Practices	</title>
	<atom:link href="https://www.tech-vision.us/comments/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tech-vision.us/</link>
	<description>Salesforce consultancy.</description>
	<lastBuildDate>Fri, 07 Jun 2024 20:58:46 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
	<item>
		<title>
		Comment on Salesforce &#124; Adding Lightning Modal to a VisualForce Page by Praba		</title>
		<link>https://www.tech-vision.us/salesforce-adding-lightning-modal-to-a-visualforce-page/#comment-84</link>

		<dc:creator><![CDATA[Praba]]></dc:creator>
		<pubDate>Fri, 07 Jun 2024 20:58:46 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13754#comment-84</guid>

					<description><![CDATA[This Modal popup display only inside the visual force page right? Is it possible to show the same popup taking control of enter page instead of Visual force page?]]></description>
			<content:encoded><![CDATA[<p>This Modal popup display only inside the visual force page right? Is it possible to show the same popup taking control of enter page instead of Visual force page?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; Inbound Webhook Integration Guide by Oleksandr Makarenko		</title>
		<link>https://www.tech-vision.us/salesforce-inbound-webhook-integration-guide/#comment-83</link>

		<dc:creator><![CDATA[Oleksandr Makarenko]]></dc:creator>
		<pubDate>Mon, 18 Mar 2024 17:16:35 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13971#comment-83</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tech-vision.us/salesforce-inbound-webhook-integration-guide/#comment-69&quot;&gt;Hugo Cruz&lt;/a&gt;.

Hi Hugo! This is just a sample code that I configured in trailhead environment. You can copy paste the code &#039;as is&#039; to your sandbox environment.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.tech-vision.us/salesforce-inbound-webhook-integration-guide/#comment-69">Hugo Cruz</a>.</p>
<p>Hi Hugo! This is just a sample code that I configured in trailhead environment. You can copy paste the code &#8216;as is&#8217; to your sandbox environment.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; The Number of Business Hours Between Two Date/Time Fields by Oleksandr Makarenko		</title>
		<link>https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-78</link>

		<dc:creator><![CDATA[Oleksandr Makarenko]]></dc:creator>
		<pubDate>Thu, 08 Feb 2024 20:46:14 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13668#comment-78</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-68&quot;&gt;Cesar&lt;/a&gt;.

HI Cesar, please be more specific with your issue. I&#039;m not sure what you mean by &#039;doesn&#039;t seem to work correctly&#039;. One thing that I&#039;d suggest is to avoid using nested IF statements with redundant conditions such as:

&lt;pre class=&quot;ql-syntax&quot; spellcheck=&quot;false&quot;&gt;if(taskObj.IsClosed == true &#038;&#038; taskObj.CompletedDateTime != NULL){
}
&lt;/pre&gt;
You&#039;ve probably resolved the issue by now, but let me know if you still have open questions.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-68">Cesar</a>.</p>
<p>HI Cesar, please be more specific with your issue. I&#8217;m not sure what you mean by &#8216;doesn&#8217;t seem to work correctly&#8217;. One thing that I&#8217;d suggest is to avoid using nested IF statements with redundant conditions such as:</p>
<pre class="ql-syntax" spellcheck="false">if(taskObj.IsClosed == true &amp;&amp; taskObj.CompletedDateTime != NULL){
}
</pre>
<p>You&#8217;ve probably resolved the issue by now, but let me know if you still have open questions.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; The Number of Business Hours Between Two Date/Time Fields by Oleksandr Makarenko		</title>
		<link>https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-77</link>

		<dc:creator><![CDATA[Oleksandr Makarenko]]></dc:creator>
		<pubDate>Thu, 08 Feb 2024 20:41:17 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13668#comment-77</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-76&quot;&gt;Greg&lt;/a&gt;.

Hi Greg, yes it is possible. You just pass the record from a FLOW to Invocable apex. 

Notice how in the example I iterate over Trigger.New. In your invocable method you need to iterate over the collection that you pass from the flow instead of Trigger.New. And then at the very end you&#039;ll need to update that collection. 

I don&#039;t have an update in my example because my trigger runs in &#039;before update&#039; context.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-76">Greg</a>.</p>
<p>Hi Greg, yes it is possible. You just pass the record from a FLOW to Invocable apex. </p>
<p>Notice how in the example I iterate over Trigger.New. In your invocable method you need to iterate over the collection that you pass from the flow instead of Trigger.New. And then at the very end you&#8217;ll need to update that collection. </p>
<p>I don&#8217;t have an update in my example because my trigger runs in &#8216;before update&#8217; context.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; The Number of Business Hours Between Two Date/Time Fields by Greg		</title>
		<link>https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-76</link>

		<dc:creator><![CDATA[Greg]]></dc:creator>
		<pubDate>Tue, 06 Feb 2024 21:16:03 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13668#comment-76</guid>

					<description><![CDATA[I&#039;m terrible at Apex but what you&#039;ve created seems to be exactly what I am looking for. Is there any chance that logic is possible in an invocable apex action for a flow?]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m terrible at Apex but what you&#8217;ve created seems to be exactly what I am looking for. Is there any chance that logic is possible in an invocable apex action for a flow?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; Inbound Webhook Integration Guide by Hugo Cruz		</title>
		<link>https://www.tech-vision.us/salesforce-inbound-webhook-integration-guide/#comment-69</link>

		<dc:creator><![CDATA[Hugo Cruz]]></dc:creator>
		<pubDate>Wed, 20 Dec 2023 17:14:21 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13971#comment-69</guid>

					<description><![CDATA[&lt;span&gt;Good afternoon Oleksandr Makarenko! Thank you for sharing your knowledge. I would be grateful to know where you programmed these code snippets and in which environment you ran them and where I should run them when I finish development.&lt;/span&gt;]]></description>
			<content:encoded><![CDATA[<p><span>Good afternoon Oleksandr Makarenko! Thank you for sharing your knowledge. I would be grateful to know where you programmed these code snippets and in which environment you ran them and where I should run them when I finish development.</span></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; The Number of Business Hours Between Two Date/Time Fields by Cesar		</title>
		<link>https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-68</link>

		<dc:creator><![CDATA[Cesar]]></dc:creator>
		<pubDate>Tue, 10 Oct 2023 01:28:37 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13668#comment-68</guid>

					<description><![CDATA[I have tried to use it on the Task object but it doesn&#039;t seem to work correctly.&#160;

Could you help me?



&#160;&#160;trigger TestDateDaysTask on Task (before update, after update) {
&#160;&#160;&#160;&#160;BusinessHours defaultBH = [SELECT Id FROM BusinessHours WHERE IsDefault = true Limit 1];
&#160;&#160;&#160;&#160;&#160;&#160;if(defaultBH != NULL){
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(Task taskObj : trigger.new ){
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.debug(&#039;Aqui si llego&#039;);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(taskObj.IsClosed == true &#038;&#038; taskObj.CompletedDateTime != NULL){
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(taskObj.IsClosed == true &#038;&#038; taskObj.CompletedDateTime != NULL &#038;&#038; Trigger.newMap.get(taskObj.Id).CompletedDateTime != taskObj.CompletedDateTime){
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.debug(&#039;Aqui también&#039;);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;decimal result = BusinessHours.diff(defaultBH.Id, taskObj.CreatedDate, taskObj.CompletedDateTime);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;decimal resultingHours = result/(60*60*1000);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.debug(resultingHours.setScale(1));
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;taskObj.CC_TiempoTranscurridoTrigger__c = resultingHours.setScale(1);&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;}]]></description>
			<content:encoded><![CDATA[<p>I have tried to use it on the Task object but it doesn&#8217;t seem to work correctly.&nbsp;</p>
<p>Could you help me?</p>
<p>&nbsp;&nbsp;trigger TestDateDaysTask on Task (before update, after update) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;BusinessHours defaultBH = [SELECT Id FROM BusinessHours WHERE IsDefault = true Limit 1];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(defaultBH != NULL){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(Task taskObj : trigger.new ){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.debug(&#8216;Aqui si llego&#8217;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(taskObj.IsClosed == true &amp;&amp; taskObj.CompletedDateTime != NULL){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(taskObj.IsClosed == true &amp;&amp; taskObj.CompletedDateTime != NULL &amp;&amp; Trigger.newMap.get(taskObj.Id).CompletedDateTime != taskObj.CompletedDateTime){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.debug(&#8216;Aqui también&#8217;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decimal result = BusinessHours.diff(defaultBH.Id, taskObj.CreatedDate, taskObj.CompletedDateTime);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decimal resultingHours = result/(60*60*1000);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.debug(resultingHours.setScale(1));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;taskObj.CC_TiempoTranscurridoTrigger__c = resultingHours.setScale(1);&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; How to schedule apex to run every 15 mins? by Oleksandr Makarenko		</title>
		<link>https://www.tech-vision.us/salesforce-how-to-schedule-apex-to-run-every-15-mins/#comment-67</link>

		<dc:creator><![CDATA[Oleksandr Makarenko]]></dc:creator>
		<pubDate>Mon, 09 Oct 2023 02:30:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13451#comment-67</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tech-vision.us/salesforce-how-to-schedule-apex-to-run-every-15-mins/#comment-66&quot;&gt;Tejas Kshirsagar&lt;/a&gt;.

Hi Tejas! 

It&#039;s hard to give you an answer without knowing the details. This article walks you through on how to schedule Apex class to run every 15 mins. Obviously you can adjust it to run every hour for your use case.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.tech-vision.us/salesforce-how-to-schedule-apex-to-run-every-15-mins/#comment-66">Tejas Kshirsagar</a>.</p>
<p>Hi Tejas! </p>
<p>It&#8217;s hard to give you an answer without knowing the details. This article walks you through on how to schedule Apex class to run every 15 mins. Obviously you can adjust it to run every hour for your use case.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; How to schedule apex to run every 15 mins? by Tejas Kshirsagar		</title>
		<link>https://www.tech-vision.us/salesforce-how-to-schedule-apex-to-run-every-15-mins/#comment-66</link>

		<dc:creator><![CDATA[Tejas Kshirsagar]]></dc:creator>
		<pubDate>Thu, 05 Oct 2023 04:03:24 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13451#comment-66</guid>

					<description><![CDATA[Hey bro, can we just automatically run the schedule class because I&#039;m creating a package according to the requirement and it should run in the client organization each hour? Any idea?]]></description>
			<content:encoded><![CDATA[<p>Hey bro, can we just automatically run the schedule class because I&#8217;m creating a package according to the requirement and it should run in the client organization each hour? Any idea?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on Salesforce &#124; The Number of Business Hours Between Two Date/Time Fields by Oleksandr Makarenko		</title>
		<link>https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-65</link>

		<dc:creator><![CDATA[Oleksandr Makarenko]]></dc:creator>
		<pubDate>Mon, 07 Aug 2023 04:04:53 +0000</pubDate>
		<guid isPermaLink="false">https://www.tech-vision.us/?p=13668#comment-65</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-64&quot;&gt;mark J&lt;/a&gt;.

Hi Mark! I don&#039;t think real time is possible if you wanted to run reports and see live data. The closest you can get to real-time with help of out of the box tools will be by using formula fields mentioned above. But they are not as accurate as business hours apex approach.

From the single record view you might be able to setup some kind of LWC that calls business hours method on page load &#038; every second moving forward to give you &#039;real-time&#039;  data. But this will not write to a field. Only for display. This might be overkill though. 

Your best bet will be to run scheduled update every now and then.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/#comment-64">mark J</a>.</p>
<p>Hi Mark! I don&#8217;t think real time is possible if you wanted to run reports and see live data. The closest you can get to real-time with help of out of the box tools will be by using formula fields mentioned above. But they are not as accurate as business hours apex approach.</p>
<p>From the single record view you might be able to setup some kind of LWC that calls business hours method on page load &amp; every second moving forward to give you &#8216;real-time&#8217;  data. But this will not write to a field. Only for display. This might be overkill though. </p>
<p>Your best bet will be to run scheduled update every now and then.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
