Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

CRM 2015: How do I get OrganizationService in a plugin registered in sandbox

$
0
0

I'm new to CRM Online 2015. I wrote a plugin registered in isolationmode = sandbox, update of account. It should save a  typed-in telephonenumber into a custom field in a normalized form. Before this is done, the plugin should read some configurations which are saved in the root businessunit. So i need to receive the entity businessunit with a retrieve Request. Unfortunately when i debug the code organizationService is null. Is it possible to get the IOrganizationService or it is also one of the restrictions of sandbox mode?

public void Execute(IServiceProvider serviceProvider){ 
var organizationService = ExtractService<IOrganizationService>(serviceProvider);
... 
var businessunit = organizationService.Retrieve(...)
}

private static T ExtractService<T>(IServiceProvider serviceProvider){  
var typeOfService = typeof (T);   
var service = (T) serviceProvider.GetService(typeOfService);   
return service; 
}



Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>