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;
}
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