Hi All,
We are using Dynamics CRM and we try to retrieve values with the query.
Time to time we are receiving an error message like "Value cannot be null. Parameter name: item".
What we noticed is that this error occur either in context.OrganizationService.RetrieveMultiple(...) or context.OrganizationService.Retrieve(...) methods.
This methods are part of Microsoft.Xrm.Sdk.IOrganizationService:
Example of the code where the error occur:
EntityCollection results = context.OrganizationService.RetrieveMultiple(
new QueryExpression
{
EntityName = Contact.EntityLogicalName,
ColumnSet = new ColumnSet(Contact.Fields.CustomField),
Criteria =
{
Filters =
{
new FilterExpression
{
FilterOperator = LogicalOperator.And,
Conditions =
{
new ConditionExpression(Contact.Fields.ContactId, ConditionOperator.Equal, contactId),
}
}
}
},
}
);LogTrace:
Any inputs will be highly appreciated.