How can a developer warn users of SOQL governor limit violations in a trigger?
A. Use Messaging.SendEmail() to continue the transaction and send an alert to the user after the number of SOQL queries exceeds the limit.
B. Use PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number of SOQL queries exceeds the limit.
C. Use Limits.getQueries() and display an error message before the number of SOQL queries exceeds the limit.
D. Use ApexMessage.Message() to display an error message after the number of SOQL queries exceeds the limit.
Suggest answer: C
Reference:
No comments:
Please share to make the community better.