{"id":1509,"date":"2015-07-29T17:21:14","date_gmt":"2015-07-29T11:51:14","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=1509"},"modified":"2023-01-02T10:14:57","modified_gmt":"2023-01-02T04:44:57","slug":"tips-for-working-with-business-rules-in-dynamics-crm-2015-online","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2015\/07\/tips-for-working-with-business-rules-in-dynamics-crm-2015-online\/","title":{"rendered":"Tips for working with Business Rules in Dynamics CRM 2015 Online"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p>Microsoft Dynamics CRM introduced Business Rules in CRM 2013 which provides custom business logic. You can read more about how to use Business Rules from one of our earlier blogs found <a href=\"https:\/\/www.inogic.com\/blog\/2013\/09\/crm-vnext-orion-crm-2013-fall-13-update\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a><\/p>\n<p>In this blog we are going to show new abilities added in Business Rules for Dynamics CRM Update 1 as well as tips while working with Business Rules in CRM.<\/p>\n<p>In Microsoft Dynamics CRM Online Update 1 a new ability is added in Business Rules to\u00a0<strong>clear<\/strong>\u00a0the field value. This functionality was not present in previous versions.<\/p>\n<h2><strong>Example<\/strong><\/h2>\n<p>Let us see how we can use\u00a0<strong>Clear<\/strong>\u00a0field option of Business rules, step by step using a simple example:<\/p>\n<p>Consider an example where\u00a0we want to use Business rule such that if the\u00a0<strong>Credit<\/strong> <strong>Hold <\/strong>field\u00a0in\u00a0<strong>Accounts<\/strong>\u00a0Entity is set to\u00a0<strong>No<\/strong>\u00a0then\u00a0<strong>Clear<\/strong>\u00a0value of\u00a0<strong>Credit<\/strong> <strong>Limit<\/strong>\u00a0field.<\/p>\n<p>To accomplish this,<\/p>\n<p>We will first create a new\u00a0<strong>Business rule<\/strong>\u00a0on\u00a0<strong>Accounts<\/strong>\u00a0entity and name it as \u201c<strong>Clear Credit Limit\u201d<\/strong>.<\/p>\n<p>Then we will add the if condition as below:<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1510\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule.png\" alt=\"business_rule\" width=\"410\" height=\"400\" \/><\/a><\/p>\n<p>For Action we will select \u201c<strong>set field value<\/strong>\u201d option<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1511\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule1.png\" alt=\"business_rule1\" width=\"441\" height=\"496\" \/><\/a><\/p>\n<p>In the type section we get <strong>Clear<\/strong> Option which clears the value of specified field when \u201c<strong>if<\/strong>\u201d condition is true.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1512\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule2.png\" alt=\"business_rule2\" width=\"607\" height=\"232\" \/><\/a><\/p>\n<p><strong>Note<\/strong>: The <strong>Clear <\/strong>value option is <strong>not available<\/strong> for <strong>Required fields<\/strong>.<\/p>\n<p>So the final Business Rule looks as below:<\/p>\n<p>Now on Activating above business rule if the <strong>Credit hold <\/strong>field is set to <strong>No <\/strong>you will see that the Credit Limit field\u2019s value is automatically <strong>cleared.<\/strong><\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule3.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1513\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule3.png\" alt=\"business_rule3\" width=\"391\" height=\"353\" \/><\/a><\/p>\n<h2>Setting up a formula for a numeric field.<\/h2>\n<p>Another thing that we have observed while working with Business Rules is that when entering a formula and setting a value in the formula, the precision allowed in the value depends on the field being selected as one of the parties to the formula rather than the precision of the field in which the result of the formula would be set.<\/p>\n<p>Suppose, We want to set <strong>Budget<\/strong> field using following Formula:<\/p>\n<p>Budget = Annual Revenue * 0.0067<\/p>\n<p>So we have created a Custom field \u201c<strong>Budget<\/strong>\u201d of type currency with precision 4.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule4.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1514\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule4.png\" alt=\"business_rule4\" width=\"607\" height=\"355\" \/><\/a><\/p>\n<p>The <strong>Annual Revenue<\/strong> field is having precision 2.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule5.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1515\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule5.png\" alt=\"business_rule5\" width=\"607\" height=\"348\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>While writing formulas in Business rules, if we try to multiply \u201c<strong>Annual revenue<\/strong>\u201d field with a value of higher precision than the <strong>Annual Revenue<\/strong> field such as 0.0067.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule6.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1516\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule6.png\" alt=\"business_rule6\" width=\"607\" height=\"112\" \/><\/a><\/p>\n<p>Then in business rules when we click on ok it rounds up the value to the precision of <strong>Annual Revenue<\/strong> field which is the field being selected as one of the parties to the formula and not to the precision of the field in which the result of the formula would be set which in our example is <strong>Budget<\/strong>.<\/p>\n<p>In our case the value 0.0067 is rounded up to 0.01 due to precision of <strong>Annual Revenue<\/strong> is 2 not to the precision of <strong>Budget <\/strong>which is 4.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule7.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1517\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule7.png\" alt=\"business_rule7\" width=\"308\" height=\"404\" \/><\/a><\/p>\n<p><strong>Workaround<\/strong>:<\/p>\n<p>The workaround for this is to edit the <strong>Annual Revenue<\/strong> field and change its precision to higher precision. In our example the precision of <strong>Annual Revenue<\/strong> field is changed to 4.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule8.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1518\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule8.png\" alt=\"business_rule8\" width=\"607\" height=\"343\" \/><\/a><\/p>\n<p>After publishing the changes in form, we get proper precision of the field.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule9.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1519\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/business_rule9.png\" alt=\"business_rule9\" width=\"366\" height=\"346\" \/><\/a><\/p>\n<p>Need more from your Dynamics CRM? Avoid double entry data work. Check our <a href=\"http:\/\/inogic.com\/Product\/77\/Integrations\/InoLink\" target=\"_blank\" rel=\"noopener noreferrer\">Inolink<\/a> to promote orders\/invoices from Quickbooks to Dynamics CRM. Email us on crm@inogic.com for a trial or if you would like to see a live demo.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Microsoft Dynamics CRM introduced Business Rules in CRM 2013 which provides custom business logic. You can read more about how to use Business Rules from one of our earlier blogs found here In this blog we are going to show new abilities added in Business Rules for Dynamics CRM Update 1 as well as\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2015\/07\/tips-for-working-with-business-rules-in-dynamics-crm-2015-online\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[13,15,22,23,24,25],"tags":[592],"class_list":["post-1509","post","type-post","status-publish","format-standard","hentry","category-customizations","category-development","category-dynamics-crm-2015","category-dynamics-crm-2015-update-1","category-dynamics-crm-2016","category-dynamics-crm-2016-update-1","tag-dynamics-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/1509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=1509"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/1509\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=1509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=1509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=1509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}