PDII Exam Details

  • Exam Code
    :PDII
  • Exam Name
    :Salesforce Certification for Platform Developer II
  • Certification
    :Salesforce Certifications
  • Vendor
    :Salesforce
  • Total Questions
    :445 Q&As
  • Last Updated
    :Jan 19, 2026

Salesforce PDII Online Questions & Answers

  • Question 1:

    Consider the following code snippet:

    public with sharing class AccountsController {

    @AuraEnabled

    public List getAllAccounts() {

    return [SELECT Id, Name, Industry FROM Account];

    }

    }

    As part of the deployment cycle, a developer creates the following test class:

    @IsTest

    private class AccountsController_Test {

    @TestSetup

    private static void makeData() {

    User user1 = [

    SELECT Id

    FROM User

    WHERE Profile.Name = 'System Administrator'

    LIMIT 1

    ];

    User user2 = [

    SELECT Id

    FROM User

    WHERE Profile.Name = 'Standard User'

    LIMIT 1

    ];

    TestUtils.insertAccounts(10, user1.Id);

    TestUtils.insertAccounts(20, user2.Id);

    }

    @IsTest

    private static void testGetAllAccounts() {

    // Query the Standard User into memory

    List result = AccountsController.getAllAccounts();

    System.assertEquals(20, result.size());

    }

    }

    When the test class runs, the assertion fails. Which change should the developer implement in the Apex test method to ensure the test method executes successfully?

    A. Add @IsTest(seeAllData=true) to line 12 and enclose lines 15 and 16 within Test.startTest() and Test.stopTest().
    B. Add System.runAs(user) to line 14 and enclose line 15 within Test.startTest() and Test.stopTest().
    C. Query the Standard User into memory and enclose lines 15 and 16 within the System.runAs(user) method.
    D. Query the Administrator user into memory and enclose lines 15 and 16 within the System.runAs(user) method.

  • Question 2:

    A query using OR between a Date and a RecordType is performing poorly in a Large Data Volume environment. How can the developer optimize this?

    A. Break down the query into two individual queries and join the two result sets.
    B. Annotate the method with the @Future annotation.
    C. Use the Database.querySelector method to retrieve the accounts.
    D. Create a formula field to combine the CreatedDate and RecordType value, then filter based on the formula.

  • Question 3:

    Which code snippet represents the optimal Apex trigger logic for assigning a Lead's Region based on its PostalCode, using a custom Region__c object?

    A. Set zips = new Set(); for (Lead l : Trigger.new) { if (l.PostalCode != null) { zips.add(l.PostalCode); } } List regions = [ SELECT Zip_Code__c, Region_Name__c FROM Region__c WHERE Zip_Code__c IN :zips ]; Map zipMap = new Map(); for (Region__c r : regions) { zipMap.put(r.Zip_Code__c, r.Region_Name__c); } for (Lead l : Trigger.new) { if (l.PostalCode != null) { Region__c = zipMap.get(l.PostalCode); } }
    B. Set zips = new Set(); for (Lead l : Trigger.new) { if (l.PostalCode != null) { zips.add(l.PostalCode); } } for (Lead l : Trigger.new) { List regions = [ SELECT Zip_Code__c, Region_Name__c FROM Region__c WHERE Zip_Code__c IN :zips ]; for (Region__c r : regions) { if (l.PostalCode == r.Zip_Code__c) { Region__c = r.Region_Name__c; } }
    C. for (Lead l : Trigger.new) { Region__c reg = [ SELECT Region_Name__c FROM Region__c WHERE Zip_Code__c = :l.PostalCode ]; Region__c = reg.Region_Name__c; }
    D. Set zips = new Set(); for (Lead l : Trigger.new) { if (l.PostalCode != null) { zips.add(l.PostalCode); } } for (Lead l : Trigger.new) { List regions = [ SELECT Zip_Code__c, Region_Name__c FROM Region__c WHERE Zip_Code__c IN :zips ]; for (Region__c r : regions) { if (l.PostalCode == r.Zip_Code__c) { Region__c = r.Region_Name__c; } } }

  • Question 4:

    Universal Containers uses Salesforce to track orders in an Order__c object. The Order__c object has private organization-wide defaults. The Order__c object has a custom field, Quality_Controller__c, that is a lookup to User and is used to indicate that the specified user is performing quality control on the Order__c. What should be used to automatically give read-only access to the user set in the Quality_Controller__c field?

    A. User-managed sharing
    B. Record ownership
    C. Apex-managed sharing
    D. Criteria-based sharing

  • Question 5:

    Universal Containers is leading a development team that follows the source-driven development approach in Salesforce. As part of their continuous integration and delivery (CI/CD) process, they need to automatically deploy changes to multiple environments, including sandbox and production. Which mechanism or tool would best support their CI/CD pipeline in source-driven development?

    A. Salesforce CLI with Salesforce DX
    B. Change Sets
    C. Salesforce Extensions for Visual Studio Code
    D. Ant Migration Tool

  • Question 6:

    Universal Containers develops a Visualforce page that requires the inclusion of external JavaScript and CSS files. They want to ensure efficient loading and caching of the page. Which feature should be utilized to achieve this goal?

    A. Static resources
    B. RemoteAction
    C. PageBlockTable
    D. ActionFunction

  • Question 7:

    Universal Containers analyzes a Lightning web component and its Apex controller. Based on the code snippets, what change should be made to display the contacts' mailing addresses in the Lightning web component?

    Apex controller class:

    Java

    public with sharing class AccountContactsController {

    @AuraEnabled

    public static List getAccountContacts(String accountId) {

    return [SELECT Id, Name, Email, Phone FROM Contact WHERE AccountId = :accountId];

    }

    }

    A. Add a new method in the Apex controller class to retrieve the mailing addresses separately.
    B. Modify the SOQL query in the getAccountContacts method to include the MailingAddress field.
    C. Extend the lightning-datatable component to include a column for the MailingAddress field.
    D. Modify the SOQL query in the getAccountContacts method to include the MailingAddress field and update the columns attribute in the javascript file to add Mailing address fields.

  • Question 8:

    Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required?

    A. Asynchronous Data Capture Events
    B. Calendar Events
    C. Event Monitoring Log
    D. Developer Log

  • Question 9:

    A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes. Which tool or mechanism should be utilized for managing the source- driven deployment process?

    A. Data Loader
    B. Change Sets
    C. Salesforce CLI with Salesforce DX
    D. Unmanaged Packages

  • Question 10:

    Universal Charities (UC) uses Salesforce to collect electronic donations in the form of credit card deductions from individuals and corporations. When a customer service agent enters the credit card information, it must be sent to a 3rd-party payment processor for the donation to be processed. UC uses one payment processor for individuals and a different one for corporations. What should a developer use to store the payment processor settings for the different payment processors, so that their system administrator can modify the settings once they are deployed, if needed?

    A. Hierarchy custom setting
    B. Custom label
    C. Custom metadata
    D. List custom setting

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.