Hi guys,
I want to update around 7000 records using CRM SDK. I have tried this paging method, but still getting only 5000 records updated. int success = 0;
int failed = 0;
int recordCount = 0;
int recordProcessing = 1;
int pageNumberAmpli =1 ;
QueryExpression query_amplifier = new QueryExpression("lnkt_amplifiercode");
query_amplifier.Criteria = new FilterExpression();
query_amplifier.ColumnSet = new ColumnSet(true);
//query_amplifier.Criteria.AddCondition("lnkt_itcode", ConditionOperator.Equal, "BKB8291000");
query_amplifier.PageInfo = new PagingInfo();
query_amplifier.PageInfo.Count = 5000;
query_amplifier.PageInfo.PageNumber = pageNumberAmpli;
query_amplifier.PageInfo.PagingCookie = null;
query_amplifier.PageInfo.ReturnTotalRecordCount = true;
query_amplifier.Criteria.AddCondition("modifiedon", ConditionOperator.LastXMonths, 4);
//OrderExpression order = new OrderExpression();
//order.AttributeName = "lnkt_name";
//order.OrderType = OrderType.Ascending;
EntityCollection amplifier_colect = new EntityCollection();
amplifier_colect = service.RetrieveMultiple(query_amplifier);
do
{
//UPDATE SCRIPTS
}
while (amplifier_colect.MoreRecords);
{
Console.WriteLine("\n****************\nPage number {0}\n****************", query_amplifier.PageInfo.PageNumber);
Console.WriteLine("#\tMigrating Amplifier");
Console.WriteLine("Total Records Processing Per Batch: " recordProcessing);
Console.WriteLine("Number of Success: " success);
Console.WriteLine("Number of Failed : " failed);
query_amplifier.PageInfo.PageNumber =1;
query_amplifier.PageInfo.PagingCookie = amplifier_colect.PagingCookie;
recordProcessing = 0;
success = 0;
failed = 0;
}
Can you help me if there any mistake within my code ?