salesforce - Complex SOQL query for parent/child records -


i'm trying figure out efficient way build query. have "category" object , in category object there "parent_category__c" field. category product (and there "product_category__c" junction object links categories products.) product can have multiple levels of parent categories.

product -> product_category__c -> category <--|                                       |_______|  

the way system (which inherited) built causing me start bottom-up. have find product first, find product_category__c, , find categories__c. lowest level child category. efficient way query way root category -- keeping in mind have few thousand times each product.

i had thought querying categories , storing them in map reference don't know how many categories client have. large.

thanks help.

decided go recursive route...


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -