I'm using Microsoft CRM SDK to retrieve entities. I'm writing QueryExpression
with FilterExpression
.
How to write a condition, that takes two attributes in consideration? I want to retrieve entities, for which attribute "Export Date" is less than "Modified On". (ie. all that have been modified since last export).
QueryExpression query = new QueryExpression();
FilterExpression filter = new FilterExpression();
filter.FilterOperator = LogicalOperator.Or;
ConditionExpression condition = new ConditionExpression();
// ...
//how to write this condition?
filter.AddCondition(condition);
When querying CRM, the following restrictions apply:
In other words, attributes can't be compared directly in a single query.
As a rule of thumb, if your QueryExpression
can be built as Advanced Find then you're okay, otherwise you're most likely going to need intermediate queries.