Hey,
I want to update a bulk records to CRM using an console application, I have to update the two date fields, I have retrieved those records from excel now to bulk update, I have written a function like below but its still not updating
private static void UpdateCRM(OrganizationServiceProxy service)
{
for (int i = 0; i < lstentity.Count; i += 1000)
{
ExecuteMultipleRequest requestWithNoResults = new ExecuteMultipleRequest()
{
Settings = new ExecuteMultipleSettings()
{
ContinueOnError = true,
ReturnResponses = false
},
Requests = new OrganizationRequestCollection()
};
// Update the entities that were previously created.
EntityCollection update = new EntityCollection(lstentity.Skip<Entity>(i).ToList().Take<Entity>(1000).ToList());
foreach (var entity in update.Entities)
{
UpdateRequest updateRequest = new UpdateRequest { Target = entity };
requestWithNoResults.Requests.Add(updateRequest);
}
ExecuteMultipleResponse responseWithNoResults =
(ExecuteMultipleResponse)service.Execute(requestWithNoResults);
}
}
#endregion
}