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 - React.js: onClick function from child to parent -

c# - How can I have the VS Debugger break in the correct location for exceptions thrown in Async methods in a Console App? -

javascript - How to diff two immutable objects -