Hi,
I tried to understand how CRM 2013 plugin works but I face some issues with IOrganizationService in Plugin.
IPluginExecutionContext context = (IPluginExecutionContext) serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
var serviceContext = new OrganizationServiceContext(service);
QueryExpression accountQuery = new QueryExpression("account");
accountQuery.ColumnSet = new ColumnSet(true);
EntityCollection _entityCollection = (EntityCollection)service.RetrieveMultiple(accountQuery);
So it should return data to my _entityCollection object, but it throws the exception: <Message>An event was requested after the recorded event queue has been completed.</Message>.
I have no idea what does it mean and there is not much useful information on internet so just want to know where I did wrong.
this assembly has been registered in both sandbox and none and it didn't work.
Thanks!
*This post is locked for comments