Saturday, 4 February 2012

Crm 2011 Sdk helper code summary

ServerConnection class: Frequently used. This class can held information needed to help you connect to and authenticate with Dynamics CRM 2011 using the OrganizationServiceProxy and DiscoveryServiceProxy classes.

DeviceIdManager class: Sometimes used. This class registers a computing device with Windows Live ID. This class is only needed when authenticating with Dynamics Crm Online

SystemUserProvider class: Rarely used. The purpose of this class is to create users in AD and Dynamics Crm 2011

Enumeratoins for Options Sets: Often used. These enumerations can be generated from the CrmSvcUtil code generation tool.

--------The SDK description---------
ServerConnection class:
The ServerConnection class provides methods to obtain server, organization, and user logon information for any Microsoft Dynamics CRM deployment. This information is needed to connect to and authenticate with Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online using the DiscoveryServiceProxy and OrganizationServiceProxy classes. The ServerConnection class is used by most samples that ship with the Microsoft Dynamics CRM 2011 SDK.

DeviceIdManager class:
The DeviceIdManager class registers a computing device with Windows Live ID, through the generation of a device ID and password, and optionally stores that information in an encrypted format on the local disk for later reuse. This functionality is required when authenticating with Microsoft Dynamics CRM Online. The device registration is stored in the %USERPROFILE%\LiveDeviceID folder on the computing device.

The primary class method to call from your code is LoadOrRegisterDevice. For an example of how the DeviceIdManager class is used, see the GetDeviceCredentials method in the Helper Code: ServerConnection Class topic.

A Windows Azure hosted application that must authenticate with Microsoft Dynamics CRM Online should either set the PersistToFile property of DeviceIdManager to false or call the two parameter LoadOrRegisterDevice method passing in the required device ID and password. In both cases, the DeviceIdManager will not attempt to persist the device ID and password to a file.

SystemUserProvider class:
The SystemUserProvider class demonstrates how to programmatically create additional users in Active Directory and Microsoft Dynamics CRM 2011.

Several SDK samples require additional (fictitious) system users to exist in Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online, other than the logged on user, for the sample to perform its intended task. For Microsoft Dynamics CRM 2011, these samples use the SystemUserProvider class methods to create these additional required users. Since it currently is not possible to programmatically create a new Windows Live ID user, when running against a Microsoft Dynamics CRM Online server, the code just prints the required user information to the console. You can then manually add and invite those users if desired.

Enumeratoins for Options Sets:
The SDK download package includes an extension to the CrmSvcUtil code generation tool that you can use to generate enumerations for all option set values including global option sets, picklist, state, and status values. For more information, see Sample Extension to Generate Enumerations for Option Sets.

No comments:

Post a Comment