Certified Platform Developer II Exam Dumps & Practice Test
Certified Platform Developer II Questions 221–225 (page: 46)

Updated On: 10-Feb-2026

A managed package uses a list of country ISO codes and country names as reference data in many different places from within the managed package Apex code.
What is the optimal way to store and retrieve the list?

  1. Store the information in Custom Metadata and query it with SOQL
  2. Store the information in a List Custom Setting and access it with the getAll() method
  3. Store the information in a List Custom Setting and query it with SOQL
  4. Store the information in Custom Metadata and access it with the getAll() method

Answer(s): B


Reference:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_customsettings.htm



Lightning Aura Component


Lightning Aura Controller


Apex Controller


Given the code above, which two changes need to be made in the Apex Controller for the code to work? (Choose two.)

  1. Remove line 06 from the Apex Controller and use firstName in the return
  2. Change the method signature to be global static, not public static
  3. Change the argument from JSONObject to String
  4. Annotate the entire class as @AuraEnabled instead of just the single method

Answer(s): A,C



A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests.
What should the developer do to speed up test execution?

  1. Define a method that creates test data and annotate with @testSetup
  2. Reduce the amount of test methods in the class
  3. Ensure proper usage of test data factory in all test methods
  4. Define a method that creates test data and annotate with @createData

Answer(s): A



An org has a custom object, Part_ _c. Its records are regularly imported from the company’s Enterprise Resource Planning (ERP) system.

What can be used to ensure the correct Part_ _c records are updated in Salesforce when imports are made?

  1. A Formula field
  2. An External ID field
  3. A Master-detail field
  4. A Lookup field

Answer(s): B


Reference:

https://help.salesforce.com/articleView?language=en_US&type=1&mode=1&id=000313396






The test method above tests in Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.

The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?

  1. Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced
  2. Add Test.startTest() before and Test.stopTest() after both Line 7 of the code and Line 20 of the code
  3. Add Test.startTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code
  4. Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger

Answer(s): C



Viewing page 46 of 86
Viewing questions 1 - 0 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!