CrmServiceClient is null Value – Microsoft Dynamics CRM Forum Community Forum

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


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