Friday, 6 October 2017

WCF service

CRM connector code
to get CRM service
 public IOrganizationService GetOrgInstance()

        {

            ClientCredentials cre = new ClientCredentials();

              cre.UserName.UserName = "username";
             cre.UserName.Password = "pwd";


            Uri serviceUri = new Uri("organization service");

            Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy proxy = new Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy(serviceUri, null, cre, null);

            proxy.EnableProxyTypes();

            Microsoft.Xrm.Sdk.IOrganizationService service = (Microsoft.Xrm.Sdk.IOrganizationService)proxy;


            return service;

        }


No comments:

Post a Comment

Have you ever faced an issue where you need to import some record without changing GUID of the record? For example if we need to migr...