So there's a piece of software using the deprecated Office365 Auth type and I am working to change it. However I cannot seem to get my head around how to edit the following:
String _fetchxml = getFetch();
using (CrmServiceClient crmConn = new CrmServiceClient(ConnectionString)
{
_crmService = crmConn.OrganizationServiceProxy;
EntityCollection tn = _crmService.RetrieveMultiple(new FetchExpression(_fetchxml));
This used to work via Office365, but now just throws an Object Reference error.
Could anyone help me figure this out?
The CrmServiceClient
implements IOrganizationService
, so you can skip the OrganizationServiceProxy
and directly use crmConn
:
var tn = crmConn.RetrieveMultiple(new FetchExpression(_fetchxml));
Beyond that, maybe check the version of the Xrm.Tooling
NuGet package you're using. If it's not the latest, you might want to update.