Free Salesforce PDI Exam Braindumps (page: 16)

How should a developer avoid hitting the governor limits in test methods?

  1. Use @TestVisible on methods that create records.
  2. Use Test.loadData() to load data from a static resource.
  3. Use @IsTest (SeeAllData=true) to use existing data.
  4. Use Test.startTest() to reset governor limits.

Answer(s): D



A developer encounters APEX heap limit errors in a trigger.
Which two methods should the developer use to avoid this error? (Choose two.)

  1. Use the transient keyword when declaring variables.
  2. Query and store fields from the related object in a collection when updating related objects.
  3. Remove or set collections to null after use.
  4. Use SOQL for loops instead of assigning large queries results to a single collection and looping through the collection.

Answer(s): A,D



A lead object has a custom field Prior_Email__c. The following trigger is intended to copy the current Email into the Prior_Email__c field any time the Email field is changed:

Which type of exception will this trigger cause?

  1. A null reference exception
  2. A compile time exception
  3. A DML exception
  4. A limit exception when doing a bulk update

Answer(s): C



A Visualforce page is required for displaying and editing Case records that includes both standard and custom functionality defined in an Apex class called myControllerExtension.
The Visualforce page should include which <apex:page> attribute(s) to correctly implement controller functionality?

  1. controller="Case" and extensions="myControllerExtension"
  2. extensions="myControllerExtension"
  3. controller="myControllerExtension"
  4. standardController="Case" and extensions="myControllerExtension"

Answer(s): D






Post your Comments and Discuss Salesforce PDI exam prep with other Community members:

PDI Exam Discussions & Posts