locked
Find break hours in work hours(from user entity) in crm 2013 RRS feed

  • Question

  • I have set the working hours from user entity in crm like thi

    8 AM to 1 PM 1 Pm to 2 PM break hours 2 PM to 5 PM

    I have used following code which is making sure that the user is available or not.

    QueryScheduleRequest scheduleRequest = new QueryScheduleRequest
            {
                ResourceId = Guid.Parse("E086A8A2-A741-4BB8-8BFC-61829949CBD9"),
                Start = DateTime.Now.ToUniversalTime(),
                End = DateTime.Now.AddMinutes(1).ToUniversalTime(),
                TimeCodes = new TimeCode[] { TimeCode.Available }
    
            };
            QueryScheduleResponse scheduleResponse = (QueryScheduleResponse)_serviceProxy.Execute(scheduleRequest);
    
    
            if (scheduleResponse.TimeInfos.Length > 0)
            {
                 // User is available
            }

    Now if i check this code between 1 PM to 2 PM still it is showing me user is available in spite of it is break time. Is there any way by which we can find that it is break hours. Above code is working like if i check out side between 8 AM to 5PM then and then It does not show User is available. I dont want to include break time

    Friday, May 23, 2014 1:08 PM