How To : Delete a Record in Microsoft Dynamics CRM Using .Net SDK

The following code will show you who to delete a record of any entity type using .Net.


// Create Request
DeleteRequest Request = new DeleteRequest();

// Set Target (record you want to delete)
Request.Target = new EntityReference("account", new Guid("72876387-9E5C-E111-B314-1CC1DEF1353B"));

// Execute Request
DeleteResponse Response = (DeleteResponse)_serviceProxy.Execute(Request);

Note: you can find A way to initialize a service proxy at the following link