Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2019 release wave 2 Discover the latest updates and new features to Dynamics 365 planned through March 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I have a requirement wherein i need to delete the duplicate records from a console application.
I have the duplicate records guid in a CSV file, I want to read these records GUID and update a field from a console application.
How do i do it?
Could you elaborate on your needs?
Use this sample code to delete records given the Ids in a csv file. In my case, the Ids are in the first column.
static void Main(string args)
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = "YourUserName";
clientCredentials.UserName.Password = "YourPassword";
//use your Uri
IOrganizationService organizationService = (IOrganizationService)new OrganizationServiceProxy(new Uri(""), null, clientCredentials, null);
using (StreamReader sr = new StreamReader("accounts.txt"))
int lineNumber = 0;
while ((accountLine = sr.ReadLine()) != null)
//skip the header
if (lineNumber > 0)
string cols = accountLine.Split(';');
string accountId = cols;
Console.WriteLine("account: " + accountId + " is removed");
Mehdi EL Amri.
Please tick as verified if the answer is useful.
Business Applications communities