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 311:

    Consider the following code snippet:

    public with sharing class AccountsController { @AuraEnabled public List<Account> 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<Account> 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 312:

    A developer recently released functionality to production that performs complex commission calculations in Apex code called from an Opportunity trigger. Users report that the calculations seem incorrect because the values they see for commissions are wrong.

    The developer has representative test data and passing test methods in their developer sandbox.

    Which three tools or techniques should the developer use to execute the code and pause it at key lines to visually inspect values of various Apex variables? (Choose Three)

    A. Apex Interactive Debugger
    B. Developer Console
    C. Breakpoints
    D. Apex Replay Debugger
    E. Workbench

  • Question 313:

    What is the correct order of execution for Visualforce Page "postback" requests (when user interaction requires a page update)?

    A. 1) Decode View State2) Evaluate expressions and method calls for the main page and custom components3) Upon successful completion, Evaluate the action that triggered the postback4) Upon successful completion, Update data and redirect user/update view state5) HTML sent to browser
    B. 1) Evaluate expressions and method calls for the main page and custom components2) Decode View State3) Upon successful completion, Update data and redirect user/update view state4) Upon successful completion, Evaluate the action that triggered the postback5) HTML sent to browser
    C. 1) Decode View State2) Evaluate expressions and method calls for the main page and custom components3) Upon successful completion, Update data and redirect user/update view state4) Upon successful completion, Evaluate the action that triggered the postback5) HTML sent to browser

  • Question 314:

    Which of the following standard fields are indexed? (Choose three.)

    A. Name
    B. CreatedBy
    C. SystemModStamp
    D. LastModifedDdate
    E. RecordType

  • Question 315:

    Refer to the code below:

    When the code runs, it results In a System Limit Exception with the error message: Apex heap size too large.

    What should be done to fix this error?

    A. Use a SOQL for loop to process the data.
    B. Convert the Lis: into a 5tc.
    C. Use Limits.getLimitHeapSize().
    D. Use a try/catch block to catch the error.

  • Question 316:

    If you wanted to create a record following the update of another (with data from the source object), what is the most customizable approach?

    A. Workflow Rule
    B. Process Builder
    C. After update Trigger
    D. Flow

  • Question 317:

    Where in a query can you use Geolocation and Distance? (Choose two.)

    A. Select clause
    B. Filter clause
    C. Order By clause
    D. Group By clause

  • Question 318:

    A developer created a class that implement he Queueable interface, as follows:

    public class without sharing OrderQueueableJob implements Queueable {

    public void execute(QueueableContext context) { // implementation logic

    System.enqueueJob(new FollowUpJob());

    }

    }

    As part of the deployment process, the developer is asked to create a corresponding test class. Which two actions should the developer take to successfully execute the test class? (Choose Two)

    A. Ensure the running user of the test class has, at least, the View All permission on the Order object
    B. Enclose System.enqueueJob (new orderQueueable Job ( }) within Test. starttest and Test, stoptest ()
    C. Implement seeAllData-true to ensure the Queueable )ob is able to run in bulk mode.
    D. Implement Test.isRunningtest ( ) to prevent chaining jobs during test execution.

  • Question 319:

    A developer implemented a custom data table in a Lightning web component with filter functionality. However, users are submitted support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records the selected filters.

    What should the developer do to improve performance of the component?

    A. Use setStorable() in the Apex method to store the response in the client-side cache
    B. Return all records into a list when the component is created and filter the array in JavaScript
    C. Use SOSL to Query the records on filter change.
    D. Use a selective SOQL query with a custom index.

  • Question 320:

    A developer is building a Lightning web component to get data from an Apex method called getData that takes a parameter, name. The data should be retrieved when the user clicks the Load Data button.

    Exhibit.

    import { LightningElement } from 'lwc';

    import getData from '@salesforce/apex/AccountInfo.getData';

    export default class AccountInfo extends LightningElement { account;

    name;

    nameChanged(evt) { this.name = evt.target.value;

    }

    loadData() {

    }

    }

    Component Markup Snippet:

    <lightning-button label="Load Data" onclick={loadData}></lightning-button> <lightning-input type="text" label="Name" value={name} onchange={nameChanged}></lightning-input>

    What must be added to get the data?

    A. Add @wire(getData, { name: '$name' }) to the account field and add this.account = getData(); to the loadData() function.
    B. Add this.account = getData(this.name); to the loadData() function.
    C. Add getData({ name: this.name }).then(result => { this.account = result; }); to the loadData() function.
    D. Add @wire(getData, { name: '$name' }) to the account field and delete loadData() because it is not needed.

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.