
I'm trying to get records that are filtered according to the same field (activitycategory) but different values, when I add more than one condition on the same value I get zero results, this is my code,is there a way to filter according to multiple fields or should I run a new query for each condition:
QueryExpression query = new QueryExpression("phonecall");
query.Criteria.AddCondition(new **ConditionExpression("activitycategory", ConditionOperator.Equal, GetConfigByKey("Marketing")));**
**//query.Criteria.AddCondition(new ConditionExpression("activitycategory", ConditionOperator.Equal, GetConfigByKey("Fun")));**
**//query.Criteria.AddCondition(new ConditionExpression("activitycategory", ConditionOperator.Equal, GetConfigByKey("Important")));**
query.Criteria.AddCondition(new ConditionExpression("statecode", ConditionOperator.Equal, 0));
query.ColumnSet = new ColumnSet("statecode");
LinkEntity transmitLink = new LinkEntity("phonecall", "transmit", "regardingobjectid", "transmitid", JoinOperator.Inner);
transmitLink .LinkCriteria.AddCondition(new ConditionExpression("transmitstatus", ConditionOperator.Equal, 1));
transmitLink .EntityAlias = "phonecall";
query.LinkEntities.Add(transmitLink );
EntityCollection allPhonecalls = new EntityCollection();
*This post is locked for comments
I have the same question (0)