Free Certified Platform Developer II Exam Braindumps
Certified Platform Developer II Questions 96–100 (page: 21)

Updated On: 10-Feb-2026

1 Contact con = new Contact( LastName ='Smith', Department = 'Admin')
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=:con.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = 'HR';
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements());

Given the following code, what value will be output in the logs by line #8?

  1. 5
  2. 3
  3. 4
  4. 2

Answer(s): C



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



Viewing page 21 of 86
Viewing questions 101 - 105 out of 424 questions


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

AI Tutor AI Tutor 👋 I’m here to help!