Share via


IOrganizationServiceFactory.CreateOrganizationService Method (Nullable<Guid>)

 

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)

Syntax

IOrganizationService CreateOrganizationService(
    Nullable<Guid> userId
)
Function CreateOrganizationService (
    userId As Nullable(Of Guid)
) As IOrganizationService

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.

See Also

IOrganizationServiceFactory Interface
Microsoft.Xrm.Sdk Namespace

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright