Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Iterate Query Multiple Schedules Response

$
0
0

In guidArrayList i have the two Guids. I need to check the user is leave or not from work hours by using the following Code,

List<Guid> LeaveUsers = new List<Guid>();
QueryMultipleSchedulesRequest scheduleRequest = new QueryMultipleSchedulesRequest();
scheduleRequest.ResourceIds = new Guid[users.Entities.Count];
int indexValue = 0;
foreach (var value in guidArrayList)
{
scheduleRequest.ResourceIds[indexValue] = new Guid(value.ToString());
indexValue++;
}
scheduleRequest.Start = DateTime.Now;
scheduleRequest.End = DateTime.Today.AddDays(1);
scheduleRequest.TimeCodes = new TimeCode[] { TimeCode.Available };

QueryMultipleSchedulesResponse scheduleResponse = (QueryMultipleSchedulesResponse)service.Execute(scheduleRequest);

I got the response in scheduleResponse , now I need to iterate the response and capture the leave users in Leaveusers list from response?

(i.e) 

Iterate the response like,

if (scheduleResponse.TimeInfos.Length <= 0)

{
   LeaveUsers .Add(//If the ResourceId value is leave then we can add the list here);
}


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>