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

    A developer is tasked by Universal Containers to build out a system to track the container repair process. Containers should be tracked as they move through the repair process, starting when a customer reports an issue and ending when the container is returned to the customer.

    Which solution meets these business requirements while following best practices?

    A. Build a mobile application using Platform Events and RFID integration to ensure proper tracking of the containers and keep the customer informed.
    B. Involve a Salesforce administrator and build out a declarative solution that will be easy to maintain and likely cost less than customized development.
    C. Build a customized Lightning Application using Application Events to ensure data integrity.
    D. Develop a new system with automated notification to move the containers through the repair process while notifying the customer that reported the issue.

  • Question 22:

    An org has a custom object, Registration__c, that has a lookup relationship to the Opportunity object.

    What should a developer use to create a stand-alone Visualforce page that displays the Registration__c records related to an Opportunity?

    A. A standard controller with a controller extension
    B. A controler extension
    C. A custom controler
    D. A standard controller

  • Question 23:

    The test method above calls a web service that updates an external system with Account information and sets the Account's Integration_Updated__c checkbox to True when it completes. The test fails to execute and exits with an error:

    "Methods defined as TestMethod do not support Web service callouts. "

    What is the optimal way to fix this?

    A. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
    B. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
    C. Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
    D. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

  • Question 24:

    A developer wrote a class named AccountHistoryManager that relies on field history tracking. The class has a static method called getAccountHistory that takes in an Account as a parameter and returns a list of associated AccountHistory object records.

    The following test fails:

    What should be done to make this test pass?

    A. Use Test.isRunningTest() in getAccountHistory() to conditionally return fake AccountHistory records.
    B. Use @isTest (SeeAllData=true) to see historical data from the org and query for AccountHistory records.
    C. Create AccountHistory records manually in the test setup and write a query to get them.
    D. The test method should be deleted since this code cannot be tested.

  • Question 25:

    Refer to the code snippet below:

    As part of an integration development effort, a developer is tasked to create an Apex method that solely relies on the use of foreign identifiers in order to relate new contact records to existing Accounts in Salesforce. The account object contains a field marked as an external ID, the API Name of this field is Legacy_Id_c.

    What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created contact is properly related to the Account?

    A. Account parentAccount = new Account(Legacy_Id_c = externalIdentifier);
    B. Account parentAccount = [SELECT Id FROM Account WHERE Legacy_Id_c = :externalIdentifier].Id;
    C. Account parentAccount = [SELECT Id FROM Account WHERE Legacy_Id_c = :externalIdentifier];
    D. Account parentAccount = new Account();parentAccount.Id = externalIdentifier;

  • Question 26:

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

    Example 1:

    AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId];

    for (AggregateResult ar : groupedResults)

    { System.debug('Campaign ID' + ar.get('CampaignId'));

    System.debug('Average amount' + ar.get('expr0'));

    }

    Example 2:

    AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId];

    for (AggregateResult ar : groupedResults)

    { System.debug('Campaign ID' + ar.get('CampaignId'));

    System.debug('Average amount' + ar.get('theAverage'));

    }

    Example 3:

    AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId];

    for (AggregateResult ar : groupedResults)

    { System.debug('Campaign ID' + ar.get('CampaignId'));

    System.debug('Average amount' + ar.get.AVG());

    }

    Example 4:

    AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId];

    for (AggregateResult ar : groupedResults)

    { System.debug('Campaign ID' + ar.get('CampaignId'));

    System.debug ('Average amount' + ar.theAverage);

    }

    Which two of the examples above have correct System.debug statements? (Choose two.)

    A. Example 1
    B. Example 2
    C. Example 3
    D. Example 4

  • Question 28:

    A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org from which a user will select. An Apex method prepares and returns data to the component.

    What should the developer do to determine which objects to include in the response?

    A. Check the isCustom() value on the sObject describe result.
    B. Use the getCustomObject() method from the Schema class.
    C. Import the list of all custom objects from @salesforce/schema.
    D. Check the getObjectType() value for Custom or Standard on the sObject describe result.

  • Question 29:

    To avoid duplicating code and improve maintainability, how should Universal Containers implement an API integration for code reuse?

    A. Create a reusable Apex class for the API integration and invoke it from the relevant Apex classes.
    B. Use a separate Apex class for each API endpoint to encapsulate the integration logic.
    C. Store the API integration code as a static resource and reference it in each Apex class.
    D. Include the API integration code directly in each Apex class that requires it.

  • Question 30:

    A developer wrote a Visualforce page for Sales Reps to add products to an order. The page takes a URL query parameter, productFamily, which filters the product results. The test method for the filter behavior has an assertion failing due to an incorrect number of results.

    Why could the test be failing? (Choose two.)

    A. The test does not call Test.startTest()
    B. The test does not create product data
    C. The test is not run by a System Administrator
    D. The test does not set the current page reference

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.