Michael Philip's Blog

Writing about MS Tech with strong focus on Azure & CRM

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

Leave a comment

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

Code:

// 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
https://crmprof.wordpress.com/2013/03/13/creating-organization-service-proxy-in-microsoft-dynamics-crm-2011/

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s