Saturday 9 May 2015

Convert XrmServiceContext to the IOrganizationService

A Quick post, If you use the Early Bound and you use the XrmContext strong-typed type method, but you think you miss the way you initialize the IOrganizationService in CRM, you can convert it by typing the following code..

XrmContext xrmContext = new XrmContext();
IOrganizationService service = xrmContext;

image

Hereafter, you can access your service object easily.

Hope this helps.

Thanks.

No comments:

Post a Comment

My Name is..