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 141:
A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the caller's account number before proceeding with the rest of their call script. Following best practices, what should a developer use to meet this requirement?
A. Approvals B. Flow Builder C. Apex Trigger D. Process Builder
B. Flow Builder
Question 142:
What is the transaction limit on the number of Apex jobs added to the queue?
A. 100 B. 150 C. 50 D. 200 E. There is no limit
C. 50
Question 143:
The maximum view state size of a visualforce page is______________.
A. 1mb B. 256kb C. 165kb D. 65kb E. 135kb
E. 135kb
Question 144:
An org has a Process Builder process on Opportunity that sets a custom field,CommissionBaseAmount__c, when an Opportunity is edited and the Opportunity's Amount changes.
A developer recently deployed an Opportunity before update trigger that uses the CommissionBaseAmount__c and complex logic to calculate a value for a custom field CommissionAmount_c, when an Opportunity stage changes to Closed/ Won.
Users report that when they change the Opportunity to Closed/Won and also change the Amount during the same save, the C:rr.i;5icnA.T.cur.t c is incorrect.
Which two actions should the developer take to correct this problem? (Choose Two)
A. Call the trigger from the process. B. Uncheck the recursion checkbox on the process. C. Use a static Boolean variable in the trigger. D. Call the process from the trigger.
A. Call the trigger from the process. C. Use a static Boolean variable in the trigger.
Question 145:
A developer is asked to create a Lightning web component that will be invoked via button on a record page. The component must be displayed in a model dialog.
Which two steps should the developer take to achieve this? (Choose Two)
A. Add a tarqetConfig anf set targets to lightning_RecordAction. B. In targetConfigs, add Lightning_Apppage as a target. C. Set action Type to screenAction. D. In target, add lightning_RecordAction as a target. E. Set eventType to action.
C. Set action Type to screenAction. D. In target, add lightning_RecordAction as a target.
Question 146:
What is the transaction limit on the recursive trigger depth?
A. 10 B. 17 C. 16 D. 3 E. There is no limit
C. 16
Question 147:
Employee_c is a Child object of Company_c. The Company_c object has an external Id field Company_Id_c.
How can a developer insert an Employee_c record linked to Company_c with a Company_Id_c of '999'?
A. Employee_c emp = new Employee_c(Name='Developer'); emp.Company_r = '999' insert emp; B. Employee_c emp = new Employee_c(Name='Developer'); emp.Company_c = '999' insert emp; C. Employee_c emp = new Employee_c(Name='Developer'); emp. Company_c = new Company_c(Company_Id_c='999') insert emp; D. Employee_c emp = new Employee_c(Name='Developer'); emp.Company_r = new Company_r(Company_Id_c='999') insert emp;
C. Employee_c emp = new Employee_c(Name='Developer'); emp. Company_c = new Company_c(Company_Id_c='999') insert emp;
How should <c-order> component communicate to the <c-order-order> component that an order has been selected by the user?
A. Created and fire an application event. B. Create and fire a standard DOM event. C. Create and fire a component event. D. Create and dispatch a custom event
D. Create and dispatch a custom event
Explanation
In Lightning Web Components (LWC), components communicate up the containment hierarchy (from child to parent) by creating and dispatching Custom Events. Unlike the older Aura framework, which used specific "Component" or "Application" event types (Options A and C), LWC relies on standard web browser event protocols. The child component (c-order) would instantiate a CustomEvent object, optionally including a data payload in the detail property (such as the orderId), and then call the this.dispatchEvent() method.
The parent component (c-selected-order) then listens for this event using an on prefix (e.g., onselection= {handleSelection}) in its HTML template. While you could technically use a standard DOM event (Option B), the CustomEvent interface is the platform-standard best practice in LWC for passing custom data payloads between components. Custom events allow for clean encapsulation and follow the modern "Events Up, Properties Down" design pattern common in reactive frameworks like LWC, React, and Vue.
Question 149:
A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record.
A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception.
What should the developer do to ensure the parent always has a child record?
A. Use Database.insert () and set the allorNone parameter to true. B. Use addError () on the parent record if an error occurs on the child record. C. Set a database savepoint to rollback if there are errors. D. Delete the parent record in the catch statement when an error occurs on the child record DML operation.
C. Set a database savepoint to rollback if there are errors.
Explanation
In Salesforce Apex, each DML statement is its own mini-transaction unless specific measures are taken to group them. If a developer performs an insert parent; followed by an insert child;, and the child insertion fails due to a validation rule, the parent record remains in the database. This leads to "orphaned" parent records, violating the business requirement that every parent must have a child.
To ensure "all-or-nothing" behavior across multiple DML statements, the developer should use Database. setSavepoint() and Database.rollback(). By setting a savepoint before the parent is inserted, the developer creates a "marker" for the database state. If the child insertion fails and throws an exception, the code enters the catch block. Within the catch block, the developer can call Database.rollback(sp), which reverts the database to the state before the parent was ever inserted. This ensures that either both records are created successfully or neither is created.
Option A is incorrect because allOrNone only applies to the records within a single Database.insert() call; it cannot link the success of two separate DML calls for different objects. Option D is a manual cleanup approach that is less reliable than a system-level rollback. Option B is typically used in triggers to prevent saving, but it doesn't provide the transactional control needed in a custom method with multiple DML steps. Using savepoints is the standard best practice for managing multi-object transaction atomicity.
Question 150:
What level can a hierarchy custom setting be defined for? (Choose three.)
A. Users B. Groups C. Profiles D. Roles E. Organization
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.