IOrganizationServiceFactory.CreateOrganizationService Method (Nullable<Guid>)

 

Updated: November 29, 2016

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Returns an IOrganizationService instance for the organization that the specified user is a member of.

Namespace:   Microsoft.Xrm.Sdk
Assembly:  Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)

IOrganizationService CreateOrganizationService(
	Nullable<Guid> userId
)

Parameters

userId
Type: System.Nullable<Guid>

Type: Nullable<Guid>. Specifies the system user that calls to the service are made for.

When called in a plug-in, a null value indicates the SYSTEM user and a Guid.Empty value indicates the same user as IPluginExecutionContext. UserId. Any other value indicates a specific system user.

When called in a custom workflow activity, all service calls are made in the IWorkflowExecutionContext.UserId context.

Return Value

Type: Microsoft.Xrm.Sdk.IOrganizationService

Type: IOrganizationService
An organization service factory object.

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright

Community Additions

ADD
Show: