Update Method

The Update method updates data related to an instance of an entity.

This method has only one implementation and doesn’t return a value. In the same way as the Create method, it accepts one parameter of type Entity. Because all the entities in CRM inherit from the Entity base class, you can pass any Entity class to this input parameter. To use this method, you must set at least the ID property of the entity to be updated. For example, you set the accountid property if you want to update an Account.

Listing 24.12 shows how to update an existing Account programmatically in Visual Studio 2012 with C#.

LISTING 24.12 Update an Existing Account with C#

private static string UpdateAccountName(string organizationName ...

Get Microsoft Dynamics CRM 2013 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.