{"id":366,"date":"2016-05-04T20:46:48","date_gmt":"2016-05-04T15:16:48","guid":{"rendered":"https:\/\/www.dhruvsoft.com\/blog\/?p=366"},"modified":"2024-07-26T09:44:44","modified_gmt":"2024-07-26T09:44:44","slug":"odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules","status":"publish","type":"post","link":"https:\/\/www.dhruvsoft.com\/blog\/odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules\/","title":{"rendered":"Odd Even Assignment of Records in Salesforce.com using Workflow Rules"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-368\" src=\"https:\/\/www.dhruvsoft.com\/blog\/wp-content\/uploads\/2016\/05\/Odd-Even-Assignment-179x300.png\" alt=\"Odd Even Assignment in Salesforce.com using Workflows\" width=\"179\" height=\"300\" srcset=\"https:\/\/www.dhruvsoft.com\/blog\/wp-content\/uploads\/2016\/05\/Odd-Even-Assignment-179x300.png 179w, https:\/\/www.dhruvsoft.com\/blog\/wp-content\/uploads\/2016\/05\/Odd-Even-Assignment.png 559w\" sizes=\"auto, (max-width: 179px) 100vw, 179px\" \/>Have you encountered the requirement where you want to assign all Even numbered records to one person and all Odd records to another? Here is a simple solution using the workflow rules that can help. You can use this on custom objects or even on objects that do not have Assignment rules. The requirement can also mean assigning the alternate records to two persons. This is similar to Round Robin assignment to two persons using workflow rules.<\/p>\n<p>Lets define the requirement as:<\/p>\n<blockquote><p><strong><em>Assign all records of an object that are of even number to &#8220;Joe&#8221; and odd number records to &#8220;Mary&#8221;. The odd or even number can come from a custom field &#8220;Record Number&#8221;.<\/em><\/strong><\/p><\/blockquote>\n<h4><\/h4>\n<p><!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 ez-toc-wrap-left-text counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.dhruvsoft.com\/blog\/odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules\/#Step_1_Auto_Number_field\" >Step 1: Auto Number field<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.dhruvsoft.com\/blog\/odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules\/#Step_2_Formula_field\" >Step 2: Formula field<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.dhruvsoft.com\/blog\/odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules\/#Step_3_Workflow_rules\" >Step 3: Workflow rules<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.dhruvsoft.com\/blog\/odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules\/#EvenA_assignment_workflow\" >Even\u00c2\u00a0assignment workflow<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.dhruvsoft.com\/blog\/odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules\/#OddA_Assignment_workflow\" >Odd\u00c2\u00a0Assignment workflow<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.dhruvsoft.com\/blog\/odd-even-assignment-of-records-in-salesforce-com-using-workflow-rules\/#Expanding_Odd_Even_Assignment\" >Expanding Odd \/ Even Assignment<\/a><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"Step_1_Auto_Number_field\"><\/span>Step 1: Auto Number field<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Create an auto number field with the format {0}. While creating also give number to existing records (although this will not work on existing records unless you update a field used in workflow criteria). This autonumber field will help us identify a record as Odd or Even.<\/p>\n<p>Lets assume this field is called &#8220;Record Number&#8221; with an API name as<\/p>\n<pre>Record_Number__c<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"Step_2_Formula_field\"><\/span>Step 2: Formula field<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Create a Formula field that can give an indication if the record is Odd or Even. Lets name this field as &#8220;Odd\/Even&#8221; (or you give any name you want). This field will check of our &#8220;Record Number&#8221; is Odd or Even.<\/p>\n<pre>MOD(value(Record_Number__c),2) +1<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"Step_3_Workflow_rules\"><\/span>Step 3: Workflow rules<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Create two workflows &#8211; one for assigning Odd records and one for assigning Even records.<\/p>\n<h5><span class=\"ez-toc-section\" id=\"EvenA_assignment_workflow\"><\/span>Even\u00c2\u00a0assignment workflow<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p><strong>Evaluation Criteria <\/strong><\/p>\n<p>Evaluate the rule when a record is created<\/p>\n<p>Note here we have only considered these rules to run only when created. However even if you want you can also use &#8220;Every time it is created or updated &#8230;&#8221; if your requirement is such.<\/p>\n<p><strong>Rule Criteria<\/strong><\/p>\n<pre>(Name NOT EQUALS ) AND (Odd\/Even EQUALS 1)<\/pre>\n<p>Note here we have used &#8216;Name&#8217; NOT Equals as Null in the criteria. Since Name is a mandatory field on this object this workflow will fire each time a new record is created.<\/p>\n<p><strong>Action<\/strong><\/p>\n<p>Field Update:\u00c2\u00a0Record owner (Even):\u00c2\u00a0Joe<\/p>\n<h5><span class=\"ez-toc-section\" id=\"OddA_Assignment_workflow\"><\/span>Odd\u00c2\u00a0Assignment workflow<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p><strong>Evaluation Criteria <\/strong><\/p>\n<p>Evaluate the rule when a record is created<\/p>\n<p><strong>Rule Criteria<\/strong><\/p>\n<pre>(Name NOT EQUALS ) AND (Odd\/Even EQUALS 2)<\/pre>\n<p><strong>Action<\/strong><\/p>\n<p>Field Update:\u00c2\u00a0Record owner (Odd):\u00c2\u00a0Mary<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Expanding_Odd_Even_Assignment\"><\/span>Expanding Odd \/ Even Assignment<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>This rule can be expanded further by having multiple fields in the rule criteria. We can also have a custom checkbox &#8220;Assign using an active workflow rule&#8221; if you want users to manually select a checkbox on record to assign. Make sure you uncheck the checkbox as a workflow action. You can also expand this to assign to more than two persons &#8211; however you will need to create as many workflows.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you encountered the requirement where you want to assign all Even numbered records to one person and all Odd records to another? Here is a simple solution using the workflow rules that can help. You can use this on custom objects or even on objects that do not have Assignment rules. The requirement can [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,128],"tags":[141,117,50,51,142],"class_list":["post-366","post","type-post","status-publish","format-standard","hentry","category-declarative-customization","category-sales-cloud","tag-assignment-rules","tag-sales-cloud","tag-salesforce","tag-salesforce-com","tag-workflow-rules","entry"],"_links":{"self":[{"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/posts\/366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=366"}],"version-history":[{"count":0,"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/posts\/366\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dhruvsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}