Free Certified Platform Developer II Exam Braindumps (page: 25)

Page 25 of 90

What is a recommended practice with regard to the Apex CPU limit? (Choose two.)

  1. Optimize SOQL query performance
  2. Use Map collections to cache sObjects
  3. Avoid nested Apex iterations
  4. Reduce view state in Visualforce pages

Answer(s): B,C



A developer wants to create a Visualforce page that allows a user to search for a given account by Name. If the account is found, the account details should be populated on screen. If no account is found, an error message should be displayed to the user.

How can this be accomplished? (Choose two.)

  1. Use the (apex: information) tag to display the error message
  2. Use the ApexPages.addMessage() method to add the error message
  3. Use the <apex:pageMessages> tag to display the error message
  4. Use the account.addError() method to add the error message

Answer(s): B,C



A developer has built a multi-page wizard using a single Custom Controller to query and update data. Users are complaining that the pages are loading slowly.
What will improve performance? (Choose three.)

  1. Reducing the view state
  2. Using actionRegion and rerender
  3. Turning off the standard stylesheet
  4. Setting the Apex Page attribute cache=true
  5. Using selective queries

Answer(s): A,C,E



A developer writes the following Apex trigger so that when a Case is closed, a single Survey record is created for that Case. The issue is that multiple Survey_c records are being created per Case.

trigger CaseTrigger on Case (after insert, after update){ List<Survey_c> createSurveys = new List<Survey_c>(); for (Case c : trigger.new){ if (c.IsClosed && (trigger.isInsert II trigger.isUpdate && trigger.oldMap.get(c.Id).IsClosed == false)){ createSurveys.add(new Survey_c(Case_c = c.Id)); } } insert createSurveys; }

What could be the cause of this issue?

  1. A user is creating the record as Closed
  2. A workflow rule is firing with a Create Task action
  3. A workflow rule is firing with a Field Update action
  4. A user is editing the record multiple times

Answer(s): C



Page 25 of 90



Post your Comments and Discuss Salesforce Certified Platform Developer II exam with other Community members:

Jenil Gandhi commented on November 14, 2024
Hi everyone could sone share the certification voucher for PD2.
INDIA
upvote

Aniq commented on December 02, 2023
Hi every one Could some share the certification voucher for PD2
Anonymous
upvote

Rasheed commented on June 07, 2023
Worth the price. I got 50% off when I selected 2 exams.
PAKISTAN
upvote

Lisha commented on September 21, 2022
Thank you!
Anonymous
upvote