Salesforce PDII Online Practice
Questions and Exam Preparation
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 151:
Users upload .csv files in an external system to create account and contact records in Salesforce. Up to 200 records can be created at a time. The users need to wait for a response from Salesforce in the external system, but the data does not need to synchronize between the two systems.
Based on these requirements, which method should a developer use to create the records in Salesforce?
A. REST API request using composite/vbatch/ B. REST API request using composite/tree/ C. Apex web services D. Bulk API 2.0
D. Bulk API 2.0
Question 152:
The Contact object has a custom field called Zone__c. Its data type is Text, and the field length is 3.
What is the outcome after executing the following code snippet in the org?
List<Contact> contactsToBeInserted = new List<Contact>();
Contact contactInstance = new Contact( LastName = 'Smith', Department = 'Tech', Zone__c = 'IAD' );
contactsToBeInserted.add(contactInstance);
contactInstance = new Contact( LastName = 'Sm1th', Department = 'Tech', Zone__c = 'PITT' );
contactsToBeInserted.add(contactInstance);
Database.insert(contactsToBeInserted, true);
A. Both inserts succeed and the Contact record that has the Zone value of 'PITT' is set to NULL B. A partial insert succeeds and the Contact record that has the Zone value 'IAD' is inserted C. Both inserts succeed and the Contact record that has the Zone value of 'PITT' is truncated D. An unhandled DML exception is thrown and no Contact records are inserted
D. An unhandled DML exception is thrown and no Contact records are inserted
Question 153:
A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page.
Which Apex code feature is required to facilitate this solution?
A. Streaming API B. Dynamic SOQL C. Report API D. Dynamic variable binding
B. Dynamic SOQL
Explanation
The requirement is to allow users to select which fields they want to filter by at runtime. In standard (static) SOQL, the fields in the WHERE clause must be defined at compile time (e.g., WHERE Name = :val). Because the fields themselves are not known until the user interacts with the page, the developer cannot write a static query.
Dynamic SOQL is the required feature. It allows the developer to construct the SOQL query string as a text string at runtime, incorporating the specific field names selected by the user, and then execute that string using Database.query (queryString). This provides the flexibility to build queries on the fly based on user input. Metadata API is for configuration changes, Streaming API is for push notifications, and Variable binding (:var) is used in both static and dynamic SOQL but does not solve the issue of changing the field names themselves.
Question 154:
Which two queries are selective SOQL queries and can be used for a large data set of 200,000 Account records? (Choose Two)
A. SELECT Id FROM Account WHERE Name != '' B. SELECT Id FROM Account WHERE Name = NULL C. SELECT Id FROM AccountWHERE Name = NULLAND Customer_Number__c = 'ValueA' D. SELECT Id FROM Account WHERE Id IN :listOfAccountIds
C. SELECT Id FROM AccountWHERE Name = NULLAND Customer_Number__c = 'ValueA' D. SELECT Id FROM Account WHERE Id IN :listOfAccountIds
Question 155:
What is the transaction limit on the number of "sendEmail" method calls?
A. 20 B. 10 C. 50 D. 100 E. There is no limit
B. 10
Explanation
The reserveEmailCapacity methods let you declare how many emails you want to send prior to actually sending, allowing you to handle limit errors prematurely
Question 156:
What is the transaction limit for the number of DML statements allowed?
A. 20 B. 2,000 C. 100 (synchronous), 200 (async) D. 200 (synchronous), 100 (async) E. 150
E. 150
Explanation
Includes Approval functions, rollbacks/savepoints, and System.runAs
Question 157:
As part of a custom development, a developer creates a Lightning component to show how a particular Opportunity progresses over time. The component must display the date stamp when any of the following fields change:
Amount, Probability, Stage, or Close Date.
How should the developer access the data that must be displayed?
A. Execute a SOQL query for Amount, Probability, Stage, and Close Date on the OpportunityHistory object. B. Create custom date fields on Opportunity for each field to track the previous date and execute a SOQL query for those date fields. C. Subscribe to the Opportunity Change Data Capture event in the Lightning component. D. Subscribe to the OpportunityHistory Change Data Capture event in the Lightning component.
B. Create custom date fields on Opportunity for each field to track the previous date and execute a SOQL query for those date fields.
Question 158:
MyOpportunities.js
import { LightningElement, api, wire } from 'lwc';
import getOpportunities from '@salesforce/apex/OpportunityController.findMyOpportunities';
export default class MyOpportunities extends LightningElement { @api userId;
OpportunityController.cls public with sharing class OpportunityController {
@AuraEnabled public static List<Opportunity> findMyOpportunities(Id oppOwner) { return [ SELECT Id, Name, StageName, Amount FROM Opportunity WHERE OwnerId = :oppOwner ];
}
}
A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed:
"Error retrieving data".
Which action must be completed in the Apex method to make it wireable?
A. Use the Continuation=true attribute in the Apex method. B. Edit the code to use the without sharing keyword in the Apex class. C. Use the cacheable=true attribute in the Apex method. D. Ensure the OWD for the Opportunity object is Public.
C. Use the cacheable=true attribute in the Apex method.
Explanation
To use the @wire service in a Lightning Web Component (LWC) to retrieve data from an Apex method, the Apex method must be marked as cacheable. In the provided OpportunityController class, the findMyOpportunities method is annotated with @AuraEnabled, but it lacks the mandatory cacheable=true property.
The @wire service is part of the Lightning Data Service (LDS) reactive framework. Salesforce requires wireable Apex methods to be cacheable to improve performance and ensure that data can be stored in the client-side cache. Without cacheable=true, the @wire decorator fails to execute, resulting in the "Error retrieving data" message or a similar runtime failure.
Option C is the correct fix: the developer must update the annotation to @AuraEnabled(cacheable=true).
Option A (Continuation) is only used for long-running external callouts. Option B (without sharing) may affect record visibility but is not a requirement for wireable methods. Option D (OWD settings) affects data access but does not resolve the technical requirement for using @wire.
Once marked as cacheable, Lightning Data Service can properly manage the data lifecycle for the component.
Question 159:
A developer creates an application event that has triggered an infinite loop. What may have caused this problem?
A. The event has multiple handlers registered in the project. B. The event handler calls a trigger. C. An event is fired ontouchend" and is unhandled. D. The event Is fired from a custom renderer.
D. The event Is fired from a custom renderer.
Explanation
In the Aura Component Framework, an infinite loop involving an application event is frequently caused by firing the event from a custom renderer (Option D) , specifically from the afterRender or rerender functions.
The framework's rendering lifecycle is sensitive. When a component's state changes, the renderer is invoked to update the DOM. If a developer places code inside a renderer that fires an application event, and that event --or a handler of that event--subsequently modifies an attribute on the same component, the component is marked as "dirty." This triggers the renderer to run again, which fires the event again, creating an infinite loop.
Option A is incorrect because multiple handlers simply result in multiple independent blocks of code executing, not a loop. Option C relates to touch events on mobile but wouldn't cause a loop unless the handler itself re-triggered the event. Option B is incorrect because triggers are server-side and do not directly re-fire client-side application events in a looping fashion. To avoid this, event firing should be restricted to controller or helper actions that are triggered by specific user interactions or discrete system states, rather than the automatic rendering cycle.
Question 160:
A developer created three Roll-Up Summary fields: Total_Timesheets__c, Total_Approved_Timesheets__c, and Total_Project_Timesheets__c on the custom object Project__c.
Now, the developer is tasked with creating a new field to show the ratio between total and approved timesheets.
Which statement best justifies using a formula field?
A. No test methods will be executed during deployment. B. A test class that validates the formula field is needed for deployment. C. Using a formula field reduces maintenance overhead. D. A formula field will calculate the value retroactively for existing records.
C. Using a formula field reduces maintenance overhead.
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.