{"id":1050,"date":"2014-10-30T19:20:59","date_gmt":"2014-10-30T13:50:59","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=1050"},"modified":"2014-10-30T19:20:59","modified_gmt":"2014-10-30T13:50:59","slug":"calculated-fields-introduced-in-dynamics-crm-2015","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2014\/10\/calculated-fields-introduced-in-dynamics-crm-2015\/","title":{"rendered":"Prayers Answered &#8211; Calculated Fields Introduced in Dynamics CRM 2015"},"content":{"rendered":"<p style=\"text-align: justify;\"><strong>Introduction:<\/strong><\/p>\n<p style=\"text-align: justify;\">It was one feature that other competing CRM systems had for a while and has been an \u201cask\u201d of many for many years now. Calculated field means a field that has its value calculated automatically based on the formula provided.<\/p>\n<p style=\"text-align: justify;\">Till date, this used to be achieved through scripting or may be a plugin or workflow. Business Rules still did not help accomplish this simple need. No deployment was ever made that did not require a simple calculation to be performed.<\/p>\n<p style=\"text-align: justify;\">In CRM 2015, you can now define the formula at the time of adding the field itself. This ensures it is executed at all times, server-side. But since it is updated synchronously you can see the updates immediately upon save.<\/p>\n<p style=\"text-align: justify;\"><strong>Walkthrough:<\/strong><\/p>\n<p style=\"text-align: justify;\">Now when you add a new attribute in CRM you will see a new option available that allows you to select the \u201ctype\u201d of the field being created.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/16.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1053\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/16.jpg\" alt=\"Add new attribute type\" width=\"373\" height=\"300\" \/><\/a><\/p>\n<p>It currently supports the following 3 types:<\/p>\n<p><strong>Simple<\/strong>: Simple is the normal fields that we have had all along.<\/p>\n<p><strong>Calculated<\/strong>: Calculated is when you would like the value of this field to be automatically calculated based on the calculation logic provided.<\/p>\n<p><strong>Rollup<\/strong>: Rollup fields allow for aggregation of child record values on the Parent record. An example for this would be total Invoice amount on the Account record.<\/p>\n<p>In this part of the blog, we would look at the Calculated field.<\/p>\n<p>Consider an example where we need to calculate the Commission based on the type of opportunity.<\/p>\n<p style=\"text-align: justify;\">If Opportunity <strong>Type<\/strong> is Service then commission should be 20 % of Actual Revenue and if Opportunity <strong>Type<\/strong> is Software then commission should be 30 % of actual Revenue.<\/p>\n<p>To accomplish this,<\/p>\n<p style=\"text-align: justify;\">We will first create Commission field as calculated field. As we create Commission\u00a0field as Calculated Field it becomes read only on the form.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/2.5.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1054\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/2.5.jpg\" alt=\"Commission field\" width=\"312\" height=\"87\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">To define the calculation for Commission field click on Edit button and that appears only when Field type is Calculated and Rollup.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/22.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1055\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/22.jpg\" alt=\"Commission field type\" width=\"709\" height=\"515\" \/><\/a><\/p>\n<p>This opens a UI similar to Business Rules where we can define calculation. For above requirement we have defined the conditions and actions as below:<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/32.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1056\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/32.jpg\" alt=\"Conditions and actions\" width=\"385\" height=\"567\" \/><\/a><\/p>\n<p>When setting the action and formula, you get intellisense to support the common functions<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/42.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1057\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/42.jpg\" alt=\"Intellisense common functions\" width=\"359\" height=\"200\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/52.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1058\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/10\/52.jpg\" alt=\"Intellisense for common functions\" width=\"530\" height=\"167\" \/><\/a><\/p>\n<p>With this done, now when you create a new record, upon Save you will find the Commission\u00a0automatically set.<\/p>\n<p>Calculated field type is supported for the following data types &#8211; Single line text field, Option set, Two Option, Whole Number, Decimal Number, Date Time field.<\/p>\n<p><strong>Key points of Calculated Fields:<\/strong><\/p>\n<ul>\n<li>While specifying the conditions, you can select AND or OR operator but cannot combine the two in the same condition.<\/li>\n<li>While designing the expressions, you can select fields from the lookup field entities i.e N:1.<\/li>\n<li>Calculated fields cannot be updated using Business Rules.<\/li>\n<li>Workflow does not fire on change of Calculated fields But plugins do capture the change of the Calculated fields.<\/li>\n<li>You cannot update the value of the Calculated fields directly either manually or programmatically.<\/li>\n<\/ul>\n<p><strong>Conclusion:<\/strong><\/p>\n<p style=\"text-align: justify;\">Well it\u2019s limited in the support of expressions allowed. However, it\u2019s a good start that we can look forward to have them develop further in the versions to come.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: It was one feature that other competing CRM systems had for a while and has been an \u201cask\u201d of many for many years now. Calculated field means a field that has its value calculated automatically based on the formula provided. Till date, this used to be achieved through scripting or may be a plugin\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2014\/10\/calculated-fields-introduced-in-dynamics-crm-2015\/\">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":[22,24],"tags":[236,300,597,1738],"class_list":["post-1050","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm-2015","category-dynamics-crm-2016","tag-calculated-field","tag-commission","tag-dynamics-crm-2015","tag-type"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/1050","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=1050"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/1050\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=1050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=1050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=1050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}