function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HarmpieHarmpie 

Query with Product2.Family limitation ?

When I run this query:

PriceBookEntry[] pbeList = [SELECT Id,PriceBook2Id,PriceBook2.Name,Product2.Name,Product2.Inzamelmiddel__c,Product2.Description,UnitPrice FROM PriceBookentry WHERE PriceBook2.Name='Pricebookname' AND Product2.Name in :afvalstromen AND Product2.Description in :fqList AND Product2.Inzamelmiddel__c in :piList];

 

all is fine.

 

However, the contents from field Inzamelmiddel__c were originally meanth to be stored in standard field Family. But when trying this query:

 

PriceBookEntry[] pbeList = [SELECT Id,PriceBook2Id,PriceBook2.Name,Product2.Name,Product2.Inzamelmiddel__c,Product2.Description,UnitPrice FROM PriceBookentry WHERE PriceBook2.Name='Pricebookname' AND Product2.Name in :afvalstromen AND Product2.Description in :fqList AND Product2.Family in :piList];

 

 

it seems to somehow do a DISTINCT on Family, returning an incorrect (too small) resultset!

 

Is this a know issue, or did I miss some limitation with querying theFamily (or selectlist in general) field?

 

FYI: piList is a List<String>, just like fqList and afvalstromen.

Message Edited by Harmpie on 02-23-2009 02:56 PM