I encountered the following code which solves my problem but I do not know how to call it in the Dynamics 365 system. I registered it using Plugin Deployer. However, I cannot see it in the steps section.
publicclassReadAnnotation : IPlugin { publicvoidExecute(IServiceProvider serviceProvider) { IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); ...
}
}









