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

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

    What is the transaction limit for SOQL queries?

    A. 20 (synchronous), 200 (async)
    B. 150 (synchronous), 20 (async)
    C. 150 (synchronous), 200 (async)
    D. 100 (synchronous), 200 (async)
    E. 200 (synchronous), 100 (async)

  • Question 33:

    A developer has a Visualforce page that automatically assigns ownership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.

    What can cause this problem?

    A. The test class does not use the Bulk API for loading test data.
    B. The test class does not retrieve the updated value from the database.
    C. The test class does not use the seeAllData=true annotation.
    D. The test class does not implement the Queueable interface.

  • Question 34:

    What is a consideration when using bind variables with dynamic SOQL? (Choose two.)

    A. Dynamic SOQL cannot reference fields on bind variables
    B. Dynamic SOQL cannot use bind variables
    C. Bind variables must be public or global
    D. Bind variables must be in local scope

  • Question 35:

    An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed end Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.

    When a test batch of records are loaded, the Apex trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.

    What is the most extendable way to update the Apex trigger to accomplish this?

    A. Use a List Custom Setting to disable the trigger for the user who loads the data.
    B. Add a Validation Rule to the Contract to prevent Contract creation by the user who loads the data.
    C. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.
    D. Add the Profile ID of the user who loads the data to the trigger so the trigger will not fire for this user.

  • Question 36:

    A company wants to run different logic based on an Opportunity's record type. Which code segment handles this request and follows best practices?

    A. List<RecordType> recTypes = [SELECT Id, NameFROM RecordTypeWHERE SobjectType = 'Opportunity' AND IsActive = true];Map<String, Id> recTypeMap = new Map<String, Id>();for (RecordType rt : recTypes) {recTypeMap.put(rt.Name, rt.Id);}for (Opportunity o : Trigger.new) {if (o.RecordTypeId == recTypeMap.get('New')) {// do some logic Record Type 1} else if (o.RecordTypeId == recTypeMap.get('Renewal')) {// do some logic for Record Type 2}}
    B. for (Opportunity o : Trigger.new) {if (o.RecordType.Name == 'New') {// do some logic Record Type 1} else if (o.RecordType.Name == 'Renewal') {// do some logic for Record Type 2}}
    C. List<RecordType> recTypes = [SELECT Id, NameFROM RecordTypeWHERE SobjectType = 'Opportunity' AND IsActive = true];Map<String, Id> recTypeMap = new Map<String, Id>();for (RecordType rt : recTypes) {recTypeMap.put(rt.Name, rt.Id);}for (Opportunity o : Trigger.new) {if (recTypeMap.get('New') != null && o.RecordTypeId == recTypeMap.get('New')) {// do some logic Record Type 1} else if (recTypeMap.get('Renewal') != null && o.RecordTypeId == recTypeMap.get('Renewal')) {// do some logic for Record Type 2}}
    D. Id newRecordTypeId =Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('New').getRecordTypeId();Id renewalRecordTypeId =Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Renewal').getRecordTypeId();for (Opportunity o : Trigger.new) {if (o.RecordTypeId == newRecordTypeId) {// do some logic Record Type 1} else if (o.RecordTypeId == renewalRecordTypeId) {// do some logic for Record Type 2}}

  • Question 37:

    What is a best practice when unit testing a controller? (Choose two.)

    A. Simulate user interaction by leveraging Test.setMock()
    B. Verify correct references by using getURL()
    C. Access test data by using seeAIIData=true
    D. Set query parameters by using getParameters().put

  • Question 38:

    A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created.

    Which consideration should be checked to resolve the issue?

    A. Ensure the Apex classes are on the same API version.
    B. Ensure test classes are using SeeAllData = true.
    C. Ensure the sandbox is on the same release as production.
    D. Ensure that Disable Parallel Apex Testing is unchecked.

  • Question 39:

    How can the DISTANCE and GEOLOCATION functions be used i|n SOQL queries? (Choose two.)

    A. To filter results based on distance from a latitude and longitude
    B. To get the distance results from a latitude and longitude
    C. To order results by distance from a latitude or longitude
    D. To group results in distance ranges from a latitude and longitude

  • Question 40:

    A developer has created a Team Member sObject that has a Master-Detail relationship to a Project sObject and a Lookup relationship to the User sObject. The developer must ensure that a User listed on a Team Member record has Read- Write access to the parent Project record.

    How can the developer accomplish this if the Project sObject has a Private sharing model and thousands of Project records?

    A. Create a Controller that uses the Without Sharing keyword
    B. Create a Criteria-Based Sharing Rule on the Project sObject
    C. Create a Team Member Trigger that inserts Project_Share records
    D. Create a Project Sharing Rule that shares to the Team Member Group

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.