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 91:
Universal Containers (UC) calculates commissions on their Opportunities in different ways based on complex rules that vary depending on the line of business of the Opportunity.
Whenever a new line of business Is added to Salesforce at UC, it is likely that a different calculation will need to be added too. When an Opportunity's stage is changed to Closed/Won, its commission should be calculated in real time.
What should a developer use so that different implementations of the commission calculation can be invoked on the stage change?
A. A final dass with multiple methods B. Apex Describe Schema methods C. An Apex class with @ custom enum D. An Interface and implementing classes
C. An Apex class with @ custom enum
Question 92:
A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build a single Java application that can create, retrieve, and update common object records in all of the different orgs.
Which method of integration should the application use?
A. Apex REST Web Service B. SOAP API with the partner WSDL C. SOAP API with the Enterprise WSDL D. Metadata API
A company has a custom object Sales_Help_Request_c that has a Lookup relationship to Opportunity. The Sales_Help_Request_c has a number field, Number_of_Hours_c, that represents the amount of time spent on the Sales_Help_Request_c.
A developer is tasked with creating a field, Total_Hours_c, on Opportunity that should be the sum of all of the Number_of_Hours_c values for the Sales_Help_Request_c records related to that Opportunity.
What should the developer use to implement this?
A. A workflow rule on the Sales_Help_Request_c object B. A roll-up summary field on the Opportunity object C. A trigger on the Opportunity object D. A trigger on Sales_Help_Request_c
D. A trigger on Sales_Help_Request_c
Question 94:
A Lightning web component exists in the system and displays information about the record in context as a modal. Salesforce administrators need to use this component within the Lightning App Builder.
Which two settings should the developer configure in the component's XML configuration file? (Choose Two)
A. Set the isExposed attribute to true. B. Set the isVisible attribute to true. C. Specify the target as lightning__RecordPage. D. Specify the target as lightning__AppPage.
A. Set the isExposed attribute to true. C. Specify the target as lightning__RecordPage.
Explanation
To make a Lightning Web Component (LWC) available for use in the Lightning App Builder, the developer must modify the component's configuration file (the .js-meta.xml file).
First, the isExposed tag must be set to true. By default, this is false, meaning the component is only available to other components within the namespace but not to the App Builder or Experience Builder. Setting it to true exposes it to the tools.
Second, the developer must specify where the component can be dragged and dropped by defining targets. Since the question states the component displays information about the "record in context," it implies the component is designed to live on a Record Page. Therefore, adding <target>lightning__RecordPage</target> is essential. While lightning__AppPage (Option D) is a valid target, the context of "record in context" strongly points to the Record Page target. There is no IsVisible attribute in the LWC configuration schema.
Question 95:
A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes.
Recently, users notice that fields that were recently added for one department suddenly disappear without warning. Also, Workflows that once sent emails and created tasks no longer do so.
Which two statements are true regarding these issues and resolution? (Choose two.)
A. A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production. B. Page Layouts should never be deployed via Change Sets, as this causes Workflows and Field-level Security to be reset and fields to disappear. C. The administrators are deploying their own Change Sets, thus deleting each other's fields from the objects in production. D. The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production
A. A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production. D. The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production
Explanation
This scenario highlights a common conflict in multi-admin environments known as "the last delivery wins" problem. When multiple administrators work in isolated sandboxes, they are essentially working on different versions of the same metadata. If Admin A adds a field to a Page Layout and deploys it, and then Admin B-- who does not have Admin A's changes in their sandbox--deploys their own version of that same Page Layout, Admin B's deployment will overwrite Admin A's changes in Production (Option D ). In the Metadata API (which Change Sets use), Page Layouts are treated as single files; you cannot "merge" them via a Change Set; you can only replace the destination file entirely.
To resolve this, the team needs a more sophisticated deployment pipeline. Option A is the correct resolution: the company should implement a "Staging" or "Integration" sandbox. In this model, all admins deploy their Change Sets to a single unified sandbox first. This allows them to identify conflicts and "merge" their changes (manually or via source control) before a final, combined deployment is made to Production. Option C is technically incorrect because Change Sets cannot "delete" components; they can only overwrite or add. Option B is a myth; Page Layouts can be safely deployed, but only if the underlying fields and security settings are also included and coordinated.
Question 96:
Refer to the code snippet below:
public static void updateCreditMemo(String customerId, Decimal newAmount){
List<Credit_Memo__c> toUpdate = new List<Credit_Memo__c>();
for(Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50]) {
creditMemo.Amount__c = newAmount;
toUpdate.add(creditMemo);
}
Database.update(toUpdate,false);
}
A custom object called Credit_Memo_c exist in a Salesforce environment. As part of a new feature development that retrieves and manipulates this type of record, the developer needs to ensure race conditions are prevented when a set of records are modified within an Apex transaction.
In the preceding Apex code, how can the developer alter the query statement to use SOQL features to prevent race condition within a transaction?
A. [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId FOR REFERENCE LIMIT 50] B. [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR REFERENCE] C. [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR UPDATE] D. [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId FOR UPDATE LIMIT=50]
C. [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR UPDATE]
Explanation
To prevent race conditions in Salesforce, where two or more concurrent transactions attempt to update the same record simultaneously, a developer must implement record locking. In SOQL, this is achieved using the FOR UPDATE keyword.
When a query includes the FOR UPDATE clause, the platform places an exclusive lock on the returned records for the duration of the transaction. If another process attempts to update these records or lock them with its own FOR UPDATE query, it will be forced to wait until the first transaction completes (commits or rolls back). If the lock is not released within 10 seconds, the second process will receive a QueryException.
Option C is the correct syntax to ensure that the Credit_Memo__c records are "reserved" for the current logic, preventing other threads from interfering with the newAmount calculation or update.
Question 97:
The Metadata API___________.
A. Is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, queryAII, insert, update, upsert, or delete many records asynchronously by submitting batches B. Provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it's an excellent choice of technology for use with mobile applications and web projects C. Is used to create, retrieve, update or delete records, such as accounts, leads, and custom objects, and allows you to maintain passwords, perform searches, and much more D. Is used to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment
D. Is used to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment
Question 98:
Universal Containers uses Salesforce to manage its product offerings to customers. A developer is building a custom mobile app that must allow app users to view product information, in real time, that is stored in Salesforce.
What should the developer use to get the product information from Salesforce?
A. SOAP API B. User Interface API C. Streaming API D. REST APT
D. REST APT
Question 99:
A developer Is tasked with ensuring that email addresses entered into the system for Contacts and for a Custom Object called Survey_Response__c do not belong to a list of blacklisted domains. The list of blacklisted domains will be stored In a custom object for ease of maintenance by users. Note that the Survey_Response__c object is populated via a custom visualforce page.
What is the optimal way to implement this?
A. Implement the logic in an Apex trigger on Contact and also implement the logic within the Custom visualforce page controller. B. Implement the logic in the Custom Visualforce page controller and call that method from an Apex trigger on Contact. C. Implement the logic in a helper class that is called by an Apex trigger on Contact and from the Custom Visualforce page controller. D. Implement the logic in a Validation Rule on the Contact and a validation Rule on the Survey_Response__c object.
C. Implement the logic in a helper class that is called by an Apex trigger on Contact and from the Custom Visualforce page controller.
Explanation
The requirement involves enforcing a business rule across two different objects (Contact and Survey_Response__c) and through different entry points: standard UI/Triggers for Contacts and a custom Visualforce page for Survey Responses. Implementing the logic separately in a trigger and a controller (Option A) is a poor architectural choice because it duplicates code, leading to increased maintenance effort and a higher risk of inconsistency if the logic needs to change in the future. Validation rules (Option D) are also unsuitable here because they cannot natively perform a dynamic lookup against a list of records in a separate "Blocked Domains" object without complex and unscalable workarounds. The optimal approach is to centralize the validation logic within a single "Helper" or "Service" class. This follows the DRY (Don't Repeat Yourself) principle of software development. By creating a shared method in a helper class, the developer can ensure that both the Contact trigger and the Visualforce controller use the exact same logic to verify email domains. This centralized method queries the custom object containing the blocked domains and returns a validation result. This architecture simplifies testing, ensures uniform enforcement of business rules across the entire platform, and allows administrators to update the blocked domains list without requiring any further code modifications.
Question 100:
A comply his reference data stored m multiple custom metadata records that represent del auh information and delete behavior for certain geographic regions.
When a contact is inserted, the default information should be set on the contact from the custom metadata records based on the contact's address information. Additionally, if a user attempts to delete a contact that belongs to a flagged region, the user must get an error message.
Depending on company personnel resources, what are two ways to automate this? (Choose Two)
A. Apex invocable method B. Remote action C. Flow Builder D. Apex trigger
C. Flow Builder D. Apex trigger
Explanation
This requirement involves two specific database events: record insertion (for setting defaults) and record deletion (for enforcing business rules/errors). Both Apex Triggers (Option D) and Flow Builder (Option C) are capable of handling these scenarios.
Flow Builder is the declarative (low-code) solution. A Record-Triggered Flow can be set to run "Before Save" to efficiently update the Contact's fields with metadata defaults upon insertion. Furthermore, Flow Builder now supports "Before Delete" triggers and the "Custom Error" element, allowing an administrator to block a deletion and present a specific error message to the user if the Contact belongs to a flagged region.
Apex Triggers are the programmatic solution. A developer can write a before insert trigger to perform the Custom Metadata lookup and assign field values, and a before delete trigger to evaluate the region and call addError() on the record.
Option B (Remote Action) is for Visualforce-to-Apex communication, and Option A (Invocable Method) is a piece of code called by a Flow or Process, not an entry point itself. Therefore, Triggers and Flows are the two primary automation frameworks for these requirements.
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.