I'm trying to get a list of duplicate accounts from Dynamics CRM 2011 using
this walkthrough. But at each run it shows different count such as 0, 80, 175, 450 and etc. Following is my code snippet. Can anybody let me know where I'm doing wrong.
EntityCollection en_Col = sp.RetrieveMultiple(query);
if (en_Col.Entities.Count > 0)
{ var duplicateIds = en_Col.Entities.Select((entity)=> ((DuplicateRecord)entity).BaseRecordId.Id);
ColumnSet cols = new ColumnSet(new string[] { "name", "statecode" });
foreach (var id in duplicateIds)
{
account = service.Retrieve("account", id, cols);
Console.WriteLine("Account Name: {0}, Account Status: {1}", account.Attributes["name"], account.FormattedValues["statecode"]);
}
}