IOrganizationService

Previously, the IPluginExecutionContext had methods to create the CRM and Metadata Services; now you will see these methods are gone. To use the CRM services you need to get an instance of the IOrganizationService as follows:

IOrganizationService service = factory.CreateOrganizationService(context.UserId)

The service instance returned by the IOrganizationService has the following methods:

Associate—Used to create a link between records

Create—Used to create records

Delete—Used to delete records

Disassociate—Used to remove a link between records

Excecute—Used, for example, to execute Fetch queries

Retrieve—Used to retrieve a record

RetrieveMultiple—Used to retrieve more than one record

Update—Used to update ...

Get Microsoft Dynamics CRM 2011 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.