-1

i am newly move into salesforce. am facing some exception problems. For example: In my Controller, lot of insertion and updation of data. whatever the Trigger i have inside my all, they are getting fired then am getting many SOQL Exceptions and Governor limitations.

Now Pls explain, How would you try to resolve this problem.

2

2 Answers 2

2

First you should be aware of Governor Limits of Apex. https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm

Next thing to know is how to handle them better and not to him them. http://www.salesforce.com/us/developer/docs/apex_workbook/Content/apex_govlimits_overview.htm

If you have lots of insertion of data, you better put them in a list before you insert them. Always remember to bulkify your data before having DML statements. Loops can be very useful for this specially FOR LOOPS.

I hope you get an idea for this.

-Oliver

0

Definitely avoid performing SOQL actions within a loop, and as per previous responses instead review the best practices guides - links provided in previous posts - to learn how to use Sets, Lists and Maps to bulkify your database transactions to keep things efficient. Have fun!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .