Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

CRM 2011 - Need a QueryExpression expert to modify my query

$
0
0

I am new to queryexpression and need help with modifying my query expression below:

newCondition1 = new ConditionExpression()
{

       AttributeName = "record1id",
       Operator = ConditionOperator.Equal,
       Values = { contactid }
};

newCondition2 = new ConditionExpression("record1id", ConditionOperator.In, list.Cast<object>().ToArray());
                        
FilterExpression newFilter = new FilterExpression()
{
       FilterOperator = LogicalOperator.Or,
       Conditions = { newCondition1, newCondition2 }
;
query.Criteria.Filters.Add(newFilter);

The above query works. What I need to do here is to add a couple of And conditions to the newCondition 1 and newCondition2 which is to check for the statecode to make sure it is 0 (retrieve active records only).

How do I add the And without causing issue with the Or specified above.

This site is great and I have received wonderful helps before. I hope someone (a query expression expert) look at this and provide the help/answer.

Thank you very much for your time.


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>