You need to sign in to do that
Don't have an account?
Sanjeev R 1
Best practice to bulkify the trigger
I have before update trigger on Opportunity.
Basically I need to bulkify the trigger..
When uploading data via data loader I will have list of opportunities
Oppounity[] getOpps = Trigger.new;
Now need to find the email address of Contact (Lookup) with each of these incoming opportunities..
If I will put a SOQL qurey in for loop for each opportunity.. it will hit the governer limits if I have says +100 records...
How can I have a workaround for this in apex ... so that I don't need to make a SQOL query inside the for loop in this case
thanks in advance
Check the below link.
https://developer.salesforce.com/page/Apex_Code_Best_Practices
Please review the below articles to get fair idea on maps
http://www.sfdc99.com/2013/09/28/data-collections-lists-sets-and-maps/
https://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_maps_lists.htm
1. Execution order of Apex.
2. Make a good confidenct in Map,List and Set Collections.
3. Learn how to avoid recursion
That's It !
If you find this answer useful please mark it as solution.
Thanks !
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Thanks Balaji Bondar
it make things easier to co-relate and learn when you get the related help to the sutiation you are in at the moment..
the code snippet above is really helpful. :)
Thanks Ramu,
these links are really helpful
Thanks Shiv@SFDC
yes I will go thr. Map,List and Set Collections as these are the bulding blocks to avoid recursion
thanks Anoop