CRM 2011 - Use IOrganizationService in Plugin MSCRM 2011.
Following code allow connects to the Microsoft Dynamics CRM 2011 platform using the IOrganizationService Web Service.
Thanks,
Nicola Grillo
// Comment
//use your prefered userId to get IOrganicazionService by context
private IOrganizationService getService(IServiceProvider serviceProvider, Guid userId)
{
IOrganizationServiceFactory serviceFactory =
(IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
return serviceFactory.CreateOrganizationService(userId);
}
Thanks,
Nicola Grillo