Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I have a Business requirement whenever case is created, I have to check the created case time that is between business working hours so i can route to proper queue.
I need to do it with code activity (custom workflow). I am able to get the type 2 calendar ( customer service calendar type) but i not able to find the start time and end time of business hrs.
QueryExpression query = new QueryExpression(Constants.CALENDAR_ENTITY);
query.ColumnSet = new ColumnSet(true);
ConditionExpression condition = new ConditionExpression();
condition.AttributeName = "type";
condition.Operator = ConditionOperator.Equal;
EntityCollection calendars = service.RetrieveMultiple(query);
EntityCollection calendarrule = calendars.GetAttributeValue<EntityCollection>("calendarrules");
var innerCalendarId = calendarrule.GetAttributeValue<EntityReference>("innercalendarid").Id;
var innerCalendar = service.Retrieve("calendar", innerCalendarId, new ColumnSet(true));
var innnerCalendarRule = innerCalendar.GetAttributeValue<EntityCollection>("calendarrules").Entities.FirstOrDefault();
In the code i am getting the innercalendar and also offset & Duration. But how do i check the if it is between business hours. I don't see any start/end time though it is define when we created Type 2 calendar.
Suggest me only the via code only how can solve this.
Thanks in advance!!
Temporary , I found to add this in my existing code.
TimeSpan workinhHrs = TimeSpan.FromMinutes(Convert.ToDouble(innnerCalendarRule["duration"]));
TimeSpan startTime = TimeSpan.FromMinutes(Convert.ToDouble(innnerCalendarRule["offset"]));
TimeSpan endTime = TimeSpan.FromMinutes(Convert.ToDouble(innnerCalendarRule["duration"]) + Convert.ToDouble(innnerCalendarRule["offset"]));
startOfDay = DateTime.Today.Add(startTime);
endOfDay = DateTime.Today.Add(endTime);
Business Applications communities