Delete Method
The Delete method deletes an existing instance of an entity. This method doesn’t return any value and accepts two input parameters. The first parameter is a string containing the entity type, and the second parameter is the GUID of the instance of the entity you will delete.
The example in Listing 24.7 shows how to delete a new Account programmatically in Visual Studio 2012 with C#.
LISTING 24.7 Delete New Account with C#
private static string DeleteAccount(string organizationName, Guid accountToDelete) { using (XrmSdk.OrganizationServiceClient myCrm = new XrmSdk.OrganizationServiceClient()) { try { myCrm.Endpoint.Address ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access