web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Documentation Discrepancy: IOrganizationServiceFactory.CreateOrganizationService

(0) ShareShare
ReportReport
Posted on by
My question is more of a feedback, but since I can't seem to find any sort of feedback option on Microsoft Learn, I'm trying to get myself heard in here.
 
The feedback is regarding the method IOrganizationServiceFactory.CreateOrganizationService.
 
The Microsoft Learn page states:
 
 
> 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.
 
While the SDK method summary states:
 
//
// Summary:
//     Interface to allow plug-ins to obtain IOrganizationService.
public interface IOrganizationServiceFactory
{
    //
    // Summary:
    //     Creates an instance of IOrganizationService initialized with a given user id.
    //     Null will use the current user id.
    //
    // Parameters:
    //   userId:
    //     Id of user.
    IOrganizationService CreateOrganizationService(Guid? userId);
}
 
Microsoft Learn is correct, while the SDK summary is wrong. This discrepancy should be corrected.
 
Or am I missing something?
 
The mentioned SDK DLL is included in the NuGet package Microsoft.CrmSdk.CoreAssemblies 9.0.2.56.
Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    308 on at
    There is a clear discrepancy between Microsoft Learn and the SDK documentation in Microsoft.CrmSdk.CoreAssemblies regarding the behavior of IOrganizationServiceFactory.CreateOrganizationService.
    In plug-in context within Microsoft Dataverse:
    • null → executes as SYSTEM user
    • Guid.Empty → executes as current user (context.UserId)
    However, the SDK summary incorrectly states that null uses the current user, which is misleading. Therefore, Microsoft Learn reflects the correct runtime behavior, while the SDK comment seems outdated.
    The SDK says:
    • “Null will use the current user id”
    This is:
    • Incorrect for plug-ins
    • Likely written for a more general or older context

     Recommendation: Follow Microsoft Learn documentation and explicitly pass context.UserId instead of relying on Guid.Empty to avoid confusion.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 137

#2
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans