{"id":2207,"date":"2016-04-06T17:40:45","date_gmt":"2016-04-06T17:40:45","guid":{"rendered":"http:\/\/himbap.com\/blog\/?p=2207"},"modified":"2016-04-07T05:39:28","modified_gmt":"2016-04-07T05:39:28","slug":"stop-user-from-creating-activities-for-closed-records-quick-tip","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=2207","title":{"rendered":"Stop User from creating activities for Closed Records \u2013 Quick Tip"},"content":{"rendered":"<p>We can associate activities with entity records even though they are closed (in inactive state) because CRM setup 1:N relationship with activity and other activities related entities if <strong>Activities<\/strong> checkbox is selected under entity definition. But let\u2019s say we have business requirement to stop this behavior. There is no out of the box setting to disable it, but we can implement this requirement by simply creating a quick real time workflow.<\/p>\n<p>Let&#8217;s see how we can implement this. Suppose we want to stop user from creating appointment for closed lead. We can follow below steps:<\/p>\n<p>1. Navigate to <strong>Settings-&gt; Processes <\/strong>and select <strong>New<\/strong>.<br \/>\n2. Enter details like below and click on <strong>Ok<\/strong> :<\/p>\n<p><a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/WorkflowTemplate.png\"><img decoding=\"async\" loading=\"lazy\" class=\" size-medium wp-image-2208 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/WorkflowTemplate-300x183.png\" alt=\"WorkflowTemplate\" width=\"300\" height=\"183\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/WorkflowTemplate-300x183.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/WorkflowTemplate-624x381.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/WorkflowTemplate.png 692w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n3. Change workflow <strong>Scope<\/strong> to organization.<br \/>\n4. Click on <strong>Add Step<\/strong> dropdown and add <strong>Check Condition<\/strong> step<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/condtion.png\"><img decoding=\"async\" loading=\"lazy\" class=\" size-medium wp-image-2209 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/condtion-300x138.png\" alt=\"condtion\" width=\"300\" height=\"138\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/condtion-300x138.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/condtion.png 344w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n5. Click on <strong>Condition<\/strong> hyper link and configure it like below screen:<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/validateregardinglead.png\"><img decoding=\"async\" loading=\"lazy\" class=\" size-medium wp-image-2210 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/validateregardinglead-300x145.png\" alt=\"validateregardinglead\" width=\"300\" height=\"145\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/validateregardinglead-300x145.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/validateregardinglead-624x302.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/validateregardinglead.png 769w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n6. Finally click on the immediate line under if and add <strong>Stop Workflow<\/strong> step under <strong>Add Step<\/strong> dropdown.<br \/>\n7. Select workflow status as <strong>Canceled<\/strong> and click on <strong>Set Properties<\/strong> button and write \u201cYou can&#8217;t create Appointment for Closed Leads\u201d under value text box.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/canceledworkflow.png\"><img decoding=\"async\" loading=\"lazy\" class=\" size-medium wp-image-2211 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/canceledworkflow-300x66.png\" alt=\"canceledworkflow\" width=\"300\" height=\"66\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/canceledworkflow-300x66.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/canceledworkflow.png 558w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n8. <strong>Activate<\/strong> workflow and we are done!!<br \/>\nNow if user will try to set appointment for closed lead he will get error like below<\/p>\n<p><a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/closedleads.png\"><img decoding=\"async\" loading=\"lazy\" class=\" size-medium wp-image-2212 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/closedleads-300x117.png\" alt=\"closedleads\" width=\"300\" height=\"117\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/closedleads-300x117.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2016\/04\/closedleads.png 569w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Similarly we can create more workflow for other activity types if required.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can associate activities with entity records even though they are closed (in inactive state) because CRM setup 1:N relationship with activity and other activities related entities if Activities checkbox is selected under entity definition. But let\u2019s say we have business requirement to stop this behavior. There is no out of the box setting to disable it, but we can&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=2207\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,8,275],"tags":[352,351,350],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2207"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2207"}],"version-history":[{"count":3,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2207\/revisions"}],"predecessor-version":[{"id":2215,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2207\/revisions\/2215"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}