CrmServiceClient is null Value – Microsoft Dynamics CRM Forum Community Forum

0
119
Forum Post: Change the Filter On option on Opportunity Associated View for Account form


Hi

Connections using CrmServiceClient sometimes result in null values.

It happens intermittently if you use it continuously, and most of the time, it seems that the connection is not made once an hour.

<add name=”ConnectionString”
connectionString=”AuthType=ClientSecret; url={myorg}.crm5.dynamics.com; clientid={clientid}; clientsecret={mysecret};”/>

private static IOrganizationService service;

private string _conStr = ConfigurationManager.ConnectionStrings[“ConnectionString”].ConnectionString;

public IOrganizationService CreateOrganizationWebProxyClient()
{
    CrmServiceClient client;
    client = new CrmServiceClient(_conStr);

    service = (IOrganizationService)client.OrganizationWebProxyClient != null ? (IOrganizationService)client.OrganizationWebProxyClient : (IOrganizationService)client.OrganizationServiceProxy;

    return service;
}

The code used is as above.

Sometimes I want to know why the connection doesn’t work. 



Source link

Leave a reply

Please enter your comment!
Please enter your name here