You need to sign in to do that
Don't have an account?
Efficient SOQL for record classification
Hi awesome developers!
I need to "classify" an incoming Record A based on several related fields on records B,C,D,.. etc. Therefore I need a trigger that is triggering (:D) on this new record and check more then 5 lookup relationships for the content of specific fields in the related records B,C,D ...
Following https://developer.salesforce.com/page/Apex_Code_Best_Practices #2 I should not put the query for the related records in the foreach loop on record "A" Also I need to bulkify this, so it could handle the max load of 200 records entering the trigger at once.
What would be the most efficient way to query those related records for each incoming record and classify "A" according to the values in the related records?
If you could help me out here or point me in the right direction that would be really great!
Thanks,
Markus
As per my understand by taking example here. Let say the major Object A, and there is a lookup fileds for the Object B, C and D as you mentioned. What my understanding that you are looking for is this
Let me if this help as this is just to give you an idea.
https://salesforce.stackexchange.com/questions/251498/efficient-soql-for-record-classification