Skip to main content
I need help writing a SOQL query to see Accounts that purchase only products associated with Product Family "Clauss" and/or "Camillus."

I am guessing I need to do a special query that utilizes roll ups which is a bit over my head.  Below are some details I assume would be useful in terms of the relationships between fields.

I can see the Account info from Order_Header__c

SELECT Account__C, Customer_Number__c FROM Order_Header__c LIMIT 10

If I go to Order_Header__C and Child Relatonships I see

Order_Detail__c.Order_Header__c

I can see Product Family if I do this query.

SELECT Family FROM Product2 LIMIT 10

If I go to Product2 for Child Relationships it says

Order_Detail__c.Product__c

I can see the base stock code here

SELECT Product__c, Base_Stock_Code__C FROM Order_Detail__c LIMIT 10

Thanks, Aron.
2 answers
0/9000