{"id":1452,"date":"2015-07-15T09:13:41","date_gmt":"2015-07-15T03:43:41","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=1452"},"modified":"2026-02-05T15:34:01","modified_gmt":"2026-02-05T10:04:01","slug":"calculated-fields-support-extended-for-datetime-data-types-in-dynamics-crm-2015-online-update1","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2015\/07\/calculated-fields-support-extended-for-datetime-data-types-in-dynamics-crm-2015-online-update1\/","title":{"rendered":"Calculated fields support extended for Date\/Time data types in Dynamics CRM 2015"},"content":{"rendered":"<h2 style=\"text-align: justify;\">Introduction:<\/h2>\n<p style=\"text-align: justify;\">Calculated fields was first introduced in Dynamics CRM 2015 and it further improved upon the ability to provide codeless solutions to power users to configure. You can learn more about its features from our earlier blog <a href=\"https:\/\/www.inogic.com\/blog\/2014\/10\/calculated-fields-introduced-in-dynamics-crm-2015\/\">here<\/a>.<\/p>\n<p style=\"text-align: justify;\">It provided support for most CRM data types however the calculations and formulae supported for Date\/Time fields were still limited.<\/p>\n<p style=\"text-align: justify;\">With the latest Online update, they have enhanced the operations supported on Date\/Time fields.<\/p>\n<ol style=\"text-align: justify;\">\n<li>DIFFINDAYS(start date or time, End date or time)<\/li>\n<li>DIFFINHOURS(start date or time, End date or time)<\/li>\n<li>DIFFINMINUTES(start date or time, End date or time)<\/li>\n<li>DIFFINWEEKS(start date or time, End date or time)<\/li>\n<li>DIFFINYEARS(start date or time, End date or time)<\/li>\n<li>DIFFINMONTHS(start date or time, End date or time)<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">The Rollup field has also been enhanced to support AVG as an aggregate calculation for Date\/Time fields.<\/p>\n<h2 style=\"text-align: justify;\">How does this help?<\/h2>\n<p style=\"text-align: justify;\">A very real scenario where this code be used is to calculate the Avg. time it takes for resolving a complaint.<\/p>\n<p style=\"text-align: justify;\">The Actual Units fields in the Case entity calculates the total time spent on the case by adding up the times on the individual activities associated with the case. But what if you wanted to know just how long a case had been open \u2013 case createdon \u2013 case modifiedon.<\/p>\n<p style=\"text-align: justify;\">Next it would be good to have the Avg. case resolution time per customer, to monitor if there are particular customers for which is usually takes too long to close a case. What we are looking out for here is Avg. Case closure time.<\/p>\n<h2 style=\"text-align: justify;\">Walkthrough<\/h2>\n<p style=\"text-align: justify;\">Let us see how to go about getting this set up in no time.<\/p>\n<ol style=\"text-align: justify;\">\n<li>Add the Calculated field.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1453\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields.png\" alt=\"calculated fields\" width=\"629\" height=\"368\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Since we have created a Duration field, we would calculate the difference between CreatedOn and ModifiedOn in minutes. Note. Duration field always expects the values to be provided in minutes.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1454\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields1.png\" alt=\"calculated fields1\" width=\"494\" height=\"318\" \/><\/a><\/p>\n<ol style=\"text-align: justify;\" start=\"2\">\n<li>Create the Rollup field.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 We will add the rollup field on Account to get the Avg. Resolution time.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1455\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields2.png\" alt=\"calculated fields2\" width=\"628\" height=\"435\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Rollup the time for only resolved cases.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields3.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1456\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields3.png\" alt=\"calculated fields3\" width=\"388\" height=\"347\" \/><\/a><\/p>\n<ol style=\"text-align: justify;\" start=\"3\">\n<li>Place both the fields on the Case and Account forms respectively.<\/li>\n<li>Now when you resolve the case, you will find that the case resolution time is auto calculated.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields4.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1457\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields4.png\" alt=\"calculated fields4\" width=\"629\" height=\"301\" \/><\/a><\/p>\n<ol style=\"text-align: justify;\" start=\"5\">\n<li>We quickly closed a few cases for this account so that the avg. could be calculated<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields5.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1458\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields5.png\" alt=\"calculated fields5\" width=\"630\" height=\"408\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u00a0 6. \u00a0 Now lets check how it looks on the Account form<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields6.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1459\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/07\/calculated-fields6.png\" alt=\"calculated fields6\" width=\"379\" height=\"349\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Conclusion:<\/strong><\/p>\n<p style=\"text-align: justify;\">Though this takes a step further in supporting date\/time data type in Calculated and Rollup fields, Rollup fields still do not support Date conditional operators like Last X months\/years etc. So if I wanted to get the avg. case closure time in the last 6 months, I still cannot do that. Hoping to see this included in future version to support a full code-less power-user configuration solution.<\/p>\n<p>Its just not this. Have a look at our mapping solution for Dynamics CRM,\u00a0<a href=\"https:\/\/www.maplytics.com\/\">Maplytics<\/a>\u00a0which works from with CRM. Email us on\u00a0<a href=\"mailto:crm@inogic.com\">crm@inogic.com<\/a>\u00a0for a trial or if you would like to see a live demo.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Calculated fields was first introduced in Dynamics CRM 2015 and it further improved upon the ability to provide codeless solutions to power users to configure. You can learn more about its features from our earlier blog here. It provided support for most CRM data types however the calculations and formulae supported for Date\/Time fields\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2015\/07\/calculated-fields-support-extended-for-datetime-data-types-in-dynamics-crm-2015-online-update1\/\">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,22,23,24,25],"tags":[398,597,1108],"class_list":["post-1452","post","type-post","status-publish","format-standard","hentry","category-customizations","category-dynamics-crm-2015","category-dynamics-crm-2015-update-1","category-dynamics-crm-2016","category-dynamics-crm-2016-update-1","tag-crm-2015","tag-dynamics-crm-2015","tag-microsoft-dynamics-crm-2015"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/1452","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=1452"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/1452\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=1452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=1452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=1452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}