Hello.
I am working with Microsoft Dynamics CRM 2016 On Premise (8.0.1.79). One of important business tasks in my project is to calculate estimated date and time based on starting date, specific term in minutes, service calendar and holiday schedule.
This process executes in a plugin that fires on create of an entity. From the article below I learned about the public TimeTrackingCalculation.CalculateTriggerDateTime method in the Microsoft.Crm.Service.ObjectModel assembly. This method solves the task.
https://community.dynamics.com/crm/b/bettercrm/archive/2017/08/02/list-of-undocumented-sdk-messages
I pass ID of service calendar as calendarId, starting date as startDate, term in munites as triggerDuration and execution context of a plugin. This approach works perfect in most cases, but sometimes the result of the message is unexpected.
For example, I have an incident created at 20.12.2017 11:11. This incident should be processed in 5940 minutes (or 11 days) by an operator who work from 9:00 AM to 18:00 PM (9 hour or 540 minutes) in all days except Saturday and Sunday.
Holiday schedule related to a service calendar for this operator includes russian New Year holidays (1.01.2018 - 8.01.2018).
I guess the result of CalculateTriggerDateTime with this parameters should return 12.01.2018 11:11 (20.12.2017 plus 11 business days of term plus 9 days of holidays) but it always returns 11.01.2018 18:00, two hours and 11 minutes are lost.
The same glitch is observed for some other terms when there are holidays between start date and "trigger" date.
I realize that this SDK message is undocumented and MS cannot guarantee the result, but this solution is brillrant for us due to its simplicity. Maybe, this is a known problem and there's a way to predict wrong result and correct it?
Or this is the totally bad idea and we should redesign our solution according to documented functionality?
*This post is locked for comments
Hi,
"MS cannot guarantee the result" - This is one of the main reason of only using the documented feature. As you mentioned, it is possible that its a know issue and thats why it is not a documented method to use.
I would suggest to redesign using the supported method.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156