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 201:
A developer is tasked with creating a Lightning web component that allows users to create a Case for a selected product, directly from a custom Lightning page. The input fields in the component are displayed in a non-linear fashion on top of an image of the product to help the user better understand the meaning of the fields.
Which two components should a developer use to implement the creation of the Case from the Lightning web component? (Choose Two)
A. lightning-record-edit-form B. lightning-input C. lightning-record-form D. lightning-input-field
A. lightning-record-edit-form C. lightning-record-form
Question 202:
When testing batch classes, what must a developer do? (Choose two.)
A. Use seeAllData=true B. Encapsulate code in Test.startTest() and Test.stopTest() C. Call the class execute method D. Limit the amount of records you test to fewer than 200
B. Encapsulate code in Test.startTest() and Test.stopTest() D. Limit the amount of records you test to fewer than 200
Explanation
If you use "seeAIIData=true," you are a bad person
Question 203:
A developer is asked to develop a new AppExchange application. A feature of the program creates Survey records when a Case reaches a certain stage and is of a certain Record Type. This feature needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the-box AppExchange app needs to come with a set of best practice settings that apply to most customers.
What should the developer use to store and package the custom configuration settings for the app?
A. Custom Settings B. Custom Metadata C. Custom Objects D. Custom Labels
B. Custom Metadata
Explanation
For AppExchange development, Custom Metadata Types (Option B) are the superior choice for application configurations. Unlike Custom Settings or Custom Objects, Custom Metadata records are treated as metadata , not data.
This provides three critical advantages for an AppExchange developer:
Packaging and Deployment: You can package the metadata records (the "best practice settings") as part of your managed package. When a customer installs your app, these settings are automatically populated in their org.
Environment Consistency: Custom Metadata can be deployed across sandboxes and production using standard deployment tools (Change Sets, CLI), whereas Custom Settings require manual data migration or data loading in every new environment.
Unit Testing: Apex tests can access Custom Metadata without the need for (SeeAllData=true). This ensures that your package's logic remains testable and robust across all subscriber orgs regardless of their specific data setup.
Custom Labels (Option D) are intended for translated text, not complex logic triggers. Custom Objects (Option C) consume data storage and cannot be easily packaged with default records. Custom Metadata allows the app to be "configurable" by the subscriber while providing a "standard" baseline upon installation.
Question 204:
A developer is creating a Lightning web component that contains a child component. The property stage is being passed from the parent to the child. The public property is changing, but the setOppList function is not being invoked.
What should the developer change to allow this?
A. Move the logic from connectedCalIback() to constructor(). B. Create a custom event from the parent component to set the property. C. Move the logic from connectedCallback() nto renderedCallback(). D. Move the logic to a getter/setter pair.
D. Move the logic to a getter/setter pair.
Question 205:
A developer is developing a reuseable Aura Component that will reside on an sObject Lightning Page with the following HTML snippet:
How can the component's Controller get the context of the Lightning Page that the sObject is on without requiring additional test coverage?
A. Set the sObject type as a component attribute B. Add force:hasSobjectName to the implements C. Use the getSObjectType() method in an Apex class D. Create a design attribute and configure via App builder
B. Add force:hasSobjectName to the implements
Explanation
In Aura components, Salesforce provides specific interfaces that "inject" context into the component automatically. The developer is already using force:hasRecordId, which automatically populates a recordId attribute with the ID of the current record.
To get the API Name of the sObject (e.g., "Account" or "Contact") without writing Apex code or requiring manual configuration in the App Builder, the developer should implement force:hasSObjectName (Option B). When this interface is added to the implements attribute, the framework automatically provides an attribute named sObjectName to the component.
This is the most efficient solution because:
It is purely declarative and handled by the Lightning framework.
It requires zero Apex code, meaning there is no need for additional unit tests or code coverage (satisfying the requirement "without requiring additional test coverage").
It makes the component truly reusable; you can drop it on an Account page, a Contact page, or any custom object page, and it will immediately know which object it is currently displaying.
Options A and D require manual configuration or hardcoding, which reduces reusability. Option C requires an Apex call, which adds complexity and necessitates writing test classes for coverage.
Question 206:
An org records customer order information In a custom object, Orcer__c, that has fields for the shipping address. A developer is tasked with adding code to calculate shipping charges on an order, based on a fiat percentage rate associated with the region of the shipping address.
What should the developer use to store the rates by region, so that when the changes are deployed to production no additional steps are needed for the calculation to work?
A. Custom object B. Custom metadata type C. Custom list setting D. Custom hierarchy setting
B. Custom metadata type
Explanation
The critical requirement in this scenario is that "no additional steps are needed" upon deployment. This refers to the ability to migrate not just the logic, but also the configuration data (the rates) across environments (e.g., from Sandbox to Production).
Custom Metadata Types (Option B) are the only option among those listed that are treated as metadata rather than data. This means that individual records within a Custom Metadata Type can be included in Change Sets, unlocked packages, or via the Metadata API. When the developer deploys the code, they include the metadata records for the regions and rates in the same package. Once the deployment finishes, the code can immediately query those rates and perform calculations without any manual record creation in the production environment.
In contrast, Custom List Settings (Option C), Custom Objects (Option A), and Hierarchy Settings (Option D) store their records as "data." Data is not deployable via Change Sets. If a developer used these options, they would have to manually re-enter all the regional rates in Production after the code was deployed, which violates the requirement for a seamless, automated deployment process.
Question 207:
A developer is tasked with creating a Lightning web component that is responsive on various devices.
Which two components should help accomplish this goal? (Choose Two)
A. lightning-input-location B. lightning-navigation C. lightning-layout D. lightning-layout-item
C. lightning-layout D. lightning-layout-item
Explanation
To build a responsive user interface in Lightning Web Components (LWC), developers rely on the layout system provided by the Lightning Design System (SLDS). This system is primarily implemented through two tightly coupled components:
lightning-layout and lightning-layout-item.
lightning-layout acts as a flexible container (a flexbox wrapper). It allows developers to arrange child components in a row or column and manage horizontal and vertical alignment. It provides the overall structure for the grid. lightning-layout- item is the child component that resides within a lightning-layout. It is responsible for defining the actual proportions of the content across different breakpoints (small, medium, and large devices) using attributes like size, small-device-size, medium-device-size, and large- device-size.
Together, these two components allow a developer to specify exactly how much space a piece of content should occupy depending on the user's screen size. For example, a sidebar might occupy 100% of the width on a phone but only 25% on a desktop. lightning-input-location is a specific input field for geolocation data, and lightning-navigation is a service used for page routing; neither is involved in the visual responsiveness or structural layout of the component. Therefore, options C and D are the essential building blocks for responsive design.
Question 208:
Universal Charities (UC) uses Salesforce to collect electronic donations in the form of credit card deductions from individuals and corporations. When a customer service agent enters the credit card information, it must be sent to a 3rd-party payment processor for the donation to be processed. UC uses one payment processor for individuals and a different one for corporations.
What should a developer use to store the payment processor settings for the different payment processors, so that their system administrator can modify the settings once they are deployed, if needed?
A. Hierarchy custom setting B. Custom label C. Custom metadata D. List custom setting
C. Custom metadata
Explanation
For storing application configurations and integration settings that need to be easily modified by administrators and deployed across environments, Custom Metadata Types are the preferred solution. Unlike Custom Settings (Options A and D), records within a Custom Metadata Type are considered metadata rather than data. This is a critical distinction for the development lifecycle because these records can be included in Change Sets or deployment packages. This eliminates the manual overhead and risk associated with recreating configuration records in production after a sandbox deployment.
In this scenario, UC needs to manage settings for two different payment processors. A Custom Metadata Type can be created with fields for API endpoints, merchant IDs, and security keys. An administrator can then create and edit the specific records for the "Individual" and "Corporate" processors directly in the Setup menu. Furthermore, Custom Metadata queries are efficient and do not count against standard SOQL governor limits in many contexts. While Custom Labels (Option B) are useful for translating text, they are not intended for complex, structured configuration data. Hierarchy Custom Settings are designed for user-specific overrides, which is not applicable here. Therefore, Custom Metadata provides the most robust, deployable, and administrator-friendly way to manage external service configurations.
Question 209:
A developer is asked to build a solution that will automatically send an email to the Customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all Workflow Rules have fired.
What is the optimal way to accomplish this?
A. Use a Workflow Email Alert. B. Usea MassEmailMessage() with an Apex Trigger. C. Use a SingleEmailMessage() with an Apex Trigger. D. Use an Email Alert with Process Builder.
D. Use an Email Alert with Process Builder.
Explanation
For high-volume, automated standard email communications, Email Alerts with Flow Builder (Option D) is the most scalable and maintainable solution. Salesforce imposes strict limits on the number of "Single" emails sent via Apex (typically 5,000 per 24 hours). However, emails sent via Workflow Rules, Process Builder, or Flow Builder (Email Alerts) have a much higher daily limit (2,000,000 per org).
To meet the requirement of 10,000 emails per day, an Apex-based solution using SingleEmailMessage() (Option C) would likely hit the daily limit and cause transaction failures. MassEmailMessage() (Option B) is generally intended for manual mass mailing to Contacts or Leads and is not optimized for automated, per- record trigger logic. While A Workflow Email Alert (Option A) is evaluated and executed as part of the Workflow Rule itself.
By using an Email Alert triggered by a Record-Triggered Flow , the developer leverages the platform's high- volume email engine. This approach is declarative, requires no custom code, is easier for administrators to maintain, and comfortably handles the 10,000 daily email requirement without risking governor limit exceptions. It also ensures the "criteria evaluation" happens within the standard Flow entry conditions.
Question 210:
Get Cloudy Consulting (GCC) has a multitude of servers that host its customers' websites. GCC wants to provide a server status page that is always on display in its call center. It should update in real time with any changes made to any servers. To accommodate this on the server side, a developer created a Server_Update__e platform event.
The developer is working on a Lightning web component to display the information.
What should be added to the Lightning web component to allow the developer to interact with the Server Update platform event?
A. import { subscribe, unsubscribe, onError } from 'lightning/messageChannel' B. import { subscribe, unsubscribe, onError } from 'lightning/empApi'; C. import { subscribe, unsubscribe, onError } from 'lightning/pubsub' D. import { subscribe, unsubscribe, onError } from 'lightning/ServerUpdate'
B. import { subscribe, unsubscribe, onError } from 'lightning/empApi';
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.