Hey,
I'm trying to get a product records according to linkentity filtering, I need to get all products that has Active productstatus and the linked phonecall category is fun and not open:
AKA : PRODUCT - (productstatus = Active)& (linkedphonecallcategory = fun && linkedphonecallstatus != open)
when I run my current query, the results I get are without the liked entity filter... I don't understand why.
That's my code:
QueryExpression query = new QueryExpression("product");
query.Criteria.AddCondition(new ConditionExpression("productstatus", ConditionOperator.Equal, 0));
query.ColumnSet = new ColumnSet("product");
LinkEntity phoneCallLink = new LinkEntity("product", "phonecall", "productid", "regardingobjectid", JoinOperator.LeftOuter);
FilterExpression filter1 = new FilterExpression(LogicalOperator.And);
filter1.Conditions.Add(new ConditionExpression("phonecallcategory", ConditionOperator.Equal, GetConfigByKey("fun")));
filter1.Conditions.Add(new ConditionExpression("statecode", ConditionOperator.NotEqual, 0));
phoneCallLink.LinkCriteria = filter1;
phoneCallLink.EntityAlias = "products";
EntityCollection AllProductsWithSpecificCallsNotOpen = new EntityCollection();