PDII Exam Details

  • Exam Code
    :PDII
  • Exam Name
    :Salesforce Certified Platform Developer II (Plat-Dev-301)
  • Certification
    :Salesforce Certifications
  • Vendor
    :Salesforce
  • Total Questions
    :445 Q&As
  • Last Updated
    :Jun 19, 2026

Salesforce PDII Online Questions & Answers

  • Question 301:

    Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs.

    What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?

    A. SUM() SOQL aggregate query on the Opportunity object
    B. SOQL for loop that counts the number of Opportunities records
    C. COUNT() SOQL aggregate query on the Opportunity object
    D. Apex Batch job that counts the number of Opportunity records

  • Question 302:

    A developer is building a Lightning web component that searches for Contacts and must communicate the search results to other Lightning web components when the search completes.

    What should the developer do to implement the communication?

    A. Publish an event on an event channel.
    B. Fire an application event.
    C. Publish a message on a message channel.
    D. Fire a custom component event.

  • Question 303:

    A developer has a test class that creates test data before making a mock call-out, but now receives a `You have uncommitted work pending. Please commit or rollback before calling out' error.

    What step should be taken to resolve the error?

    A. Ensure both the insertion and mock callout occur after the Test.stopTest().
    B. Ensure the records are inserted before the Test.startTest() statement and the mock callout occurs within a method annotated with StestSetup.
    C. Ensure both the insertion and mock callout occur after the Test.startTest().
    D. Ensure the records are inserted before the Test.startTest() statement and the mock callout after the Test.startTest().

  • Question 304:

    Given the following code:

    Java

    for ( Contact c : [SELECT Id, LastName FROM Contact WHERE CreatedDate = TODAY] )

    { Account a = [SELECT Id, Name FROM Account WHERE CreatedDate = TODAY LIMIT 5];

    A. AccountId = a.Id;update c;}Assuming there were 10 Contacts and five Accounts created today, what is the expected result?
    B. System. QueryException: List has more than one row after Assignment on Account.
    C. System. LimitException: To many SOQL Queries on Account.
    D. System. QueryException: To many DML Statement errors on Contact
    E. System. LimitException: Too many SOQL Queries on Contract

  • Question 305:

    How should a developer assert that a trigger with an asynchronous process has successfully run?

    A. Create at test data in the test class, use System.runAs() to invoke the trigger, then perform assertions.
    B. Insert records into Salesforce, use seeAllData-true, then perform assertions.
    C. Create all test data, use @future In the test class, then perform assertions.
    D. Create all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform assertions.

  • Question 306:

    What is the transaction limit for the number of records for SOSL?

    A. 20
    B. 2,000
    C. 100 (synchronous), 200 (async)
    D. 200 (synchronous), 100 (async)
    E. There is no limit

  • Question 307:

    Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Products__z, on the Account object that allows sales reps to specify which of UC's products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, Including product_c field.

    What should the developer do to ensure the value of Products__c is in the current user's language?

    A. Set the locale on each record in the SOQL result list.
    B. Use the locale clause in the SOQL query.
    C. Use toLabel1 Products_c in the fields list of the SOQL query.
    D. Call the translate ( ) method on each record in the SOQL result list.

  • Question 308:

    A developer created the following test method:

    @isTest(SeeAllData= true)

    public static void testDeleteTrigger(){

    Account testAccount = new Account(name = 'Test1');

    insert testAccount;

    List<Account> testAccounts = [SELECT Id, Name from Account WHERE Name like 'Test%'];

    System.assert(testAccounts.size() > 0);

    delete testAccounts;

    testAccounts = [SELECT Id, Name from Account WHERE Name like 'Test%'];

    System.assert(testAccounts.size() == 0);

    }

    The developer org has five accounts where the name starts with Test". The developer executes this test in the Developer Console. After the test code runs, which statement is true?

    A. The test will fail.
    B. There will be no accounts where the name starts with "Test".
    C. There will be five accounts where the name starts with Test".
    D. There will be six accounts where the name starts with Test".

  • Question 309:

    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?

    A. 5
    B. 3
    C. 4
    D. 2

  • Question 310:

    A developer is inserting, updating, and deleting multiple lists of records in a single transaction and wants to ensure that any error prevents all execution.

    How should the developer implement error exception handling in their code to handle this?

    A. Use Database methods to obtain lists of Database.SaveResults.
    B. Use Database.setSavepoint() and Database.rollBack() with a Try/Catch statement.
    C. Use a Try/Catch and use sObject.addError() on any failures.
    D. Use a Try/Catch statement and handle DML cleanup in the catch statement.

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Salesforce exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your PDII exam preparations and Salesforce certification application, do not hesitate to visit our Vcedump.com to find your solutions here.