I have created a query expressions which retrieves all order products associated with an order.
Here is my current query expression:
var query =newQueryExpression("salesorderdetail");
query.ColumnSet=newColumnSet(newstring[]{"salesorderdetailid","productid","new_event","new_inventory","productdescription"});
query.Criteria.AddCondition("salesorderid",ConditionOperator.Equal, combinedEntity.Id);
query.Distinct=true;EntityCollection retrieved = context.OrganizationService.RetrieveMultiple(query);
The problem is that I only want to retrieve data with a unique productid.
Is this possible using QueryExpression? Can anyone show me?
Many thanks.