{"id":124,"date":"2019-03-06T17:23:20","date_gmt":"2019-03-06T17:23:20","guid":{"rendered":"http:\/\/morepalmer.org\/?p=124"},"modified":"2019-06-03T20:47:27","modified_gmt":"2019-06-03T20:47:27","slug":"the-5-minute-time-based-workflow-or-15-minute-or-30-minute","status":"publish","type":"post","link":"https:\/\/morecpq.com\/index.php\/2019\/03\/06\/the-5-minute-time-based-workflow-or-15-minute-or-30-minute\/","title":{"rendered":"The 5 Minute Time-Based Workflow (or 15 Minute, or 30 Minute\u2026)"},"content":{"rendered":"\n<p>This was originally posted <a href=\"https:\/\/sftipshack.wordpress.com\/2013\/10\/21\/the-5-minute-time-based-workflow-or-15-minute-or-30-minute\/\">here<\/a>.  But I wanted to re-post it to save it in case it ever disappears.  This is also not super CPQ related but VERY helpful!<\/p>\n\n\n\n<p>Salesforce workflows come in 2 flavors \u2013 real time and time-based workflows.&nbsp; Time-based workflows are evaluated at the time interval you set \u2013 some number of&nbsp;<strong>hours<\/strong>&nbsp;or&nbsp;<strong>days<\/strong>&nbsp;after another date or time field on the record. But you can\u2019t set any time increment less than an hour\u2026 or can you?<\/p>\n\n\n\n<p>But I\u2019m an impatient guy.&nbsp; Sometimes, I don\u2019t want a workflow to fire right now, but I can\u2019t wait an hour.&nbsp; There may be some business processes that need to be completed in 5 minutes, or half an hour.<\/p>\n\n\n\n<p>For example \u2013 our Sales Reps may make several changes to an Opportunity over the course of 15 minutes, but I don\u2019t want to send workflow update emails after every change.&nbsp; But it is important that the Sales Manager is notified as soon as possible.&nbsp; So I\u2019d like to send a workflow email 20 minutes after the last change.<br><\/p>\n\n\n\n<p>Or, like in my Dynamic Reports object (described on this blog), I have implemented a function that allows a user to edit a value in an editable list view, refresh their screen and run a report.&nbsp; Five minutes after they run that report, I want to wipe out the value they used, so that other users can use this function.<\/p>\n\n\n\n<p>I\u2019ll admit that I found this tip someplace out here on the WWW, but I can\u2019t recall exactly where. So if it\u2019s your idea I\u2019m borrowing, thank you!<\/p>\n\n\n\n<p>To create a workflow rule that fires in less than one hour, you have to trick Salesforce.<\/p>\n\n\n\n<p>First, on the object that you need the workflow on, create a&nbsp;<strong>new custom formula field<\/strong>&nbsp;that evaluates to a Date\/Time value.&nbsp; I called my field&nbsp;<strong>Trigger Time 05<\/strong>, meaning that it\u2019s a time trigger that I use to fire a workflow in 5 minutes.<\/p>\n\n\n\n<p>What Trigger Time 05 actually does is saves a Date \/ Time value to your record that is 55 minutes in the past.&nbsp; If you save your record at 3:00 pm, the value in Trigger Time 05 will be 2:05 pm.<\/p>\n\n\n\n<p>The formula for Trigger Time 05&nbsp;<strong>= (Now() \u2013 0.038)<\/strong><\/p>\n\n\n\n<p>Then, you write a Time Based Workflow rule that fires 1 hour after&nbsp;<strong>Trigger Time 05<\/strong>.&nbsp; So, one hour after a time 55 minutes ago\u2026 is 5 minutes from now!<\/p>\n\n\n\n<p>If you have multiple time intervals you need workflows to fire at, you\u2019ll need to create multiple Trigger Time formula fields, like Trigger Time 05, Trigger Time 15, Trigger Time 30, etc.<\/p>\n\n\n\n<p>I have found that the time intervals that the workflow rules aren\u2019t exactly five minutes, but they are pretty close.<\/p>\n\n\n\n<p>As with many of the other custom formula fields I\u2019ve mentioned on this blog, you\u2019ll want to make this field accessible to all users, but don\u2019t put it on any page layouts.<\/p>\n\n\n\n<p>Here\u2019s a chart that shows the value you\u2019ll need to subtract from Now() for each 5 minute interval.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>Value in Formula<\/td><td>Minutes Ago<\/td><td>Will Fire In<\/td><\/tr><tr><td>&nbsp;0.04145<\/td><td>60<\/td><td>Minutes<\/td><td>0<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.03800<\/td><td>55<\/td><td>Minutes<\/td><td>5<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.03455<\/td><td>50<\/td><td>Minutes<\/td><td>10<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.03109<\/td><td>45<\/td><td>Minutes<\/td><td>15<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.02764<\/td><td>40<\/td><td>Minutes<\/td><td>20<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.02418<\/td><td>35<\/td><td>Minutes<\/td><td>25<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.02073<\/td><td>30<\/td><td>Minutes<\/td><td>30<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.01727<\/td><td>25<\/td><td>Minutes<\/td><td>35<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.01382<\/td><td>20<\/td><td>Minutes<\/td><td>40<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.01036<\/td><td>15<\/td><td>Minutes<\/td><td>45<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.00691<\/td><td>10<\/td><td>Minutes<\/td><td>50<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.00345<\/td><td>5<\/td><td>Minutes<\/td><td>55<\/td><td>Minutes<\/td><\/tr><tr><td>&nbsp;0.00069<\/td><td>1<\/td><td>Minute<\/td><td>59<\/td><td>Minutes<\/td><\/tr><\/tbody><\/table>\n","protected":false},"excerpt":{"rendered":"<p>This was originally posted here. But I wanted to re-post it to save it in case it ever disappears. This is also not super CPQ related but VERY helpful! Salesforce workflows come in 2 flavors \u2013 real time and time-based workflows.&nbsp; Time-based workflows are evaluated at the time interval you set \u2013 some number of&nbsp;hours&nbsp;or&nbsp;days&nbsp;after &hellip;<br \/><a href=\"https:\/\/morecpq.com\/index.php\/2019\/03\/06\/the-5-minute-time-based-workflow-or-15-minute-or-30-minute\/\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">The 5 Minute Time-Based Workflow (or 15 Minute, or 30 Minute\u2026)<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29,30],"tags":[32,31,33],"class_list":["post-124","post","type-post","status-publish","format-standard","hentry","category-sfdc","category-workflow","tag-sfdc","tag-timebased","tag-workflow"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":2,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts\/124\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}