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 251:
As part of point-to-point integration, a developer must call an external web service which, due to high demand, takes a long time to provide a response. As part of the request, the developer must collect key inputs from the end user before making the callout.
Which two elements should the developer use to implement these business requirements? (Choose Two)
A. Apex method that returns a Continuation object B. Screen now C. Process Builder D. Lightning web component
A. Apex method that returns a Continuation object D. Lightning web component
Explanation
This requirement addresses two distinct needs: a user interface for data collection and a technical solution for long-running HTTP callouts.
First, a Lightning Web Component (Option D) or a Screen Flow (Option B) could both be used to collect inputs. However, in the context of advanced development and the specific use of "Continuation," a Lightning Web Component is the standard modern pairing. It allows for a rich, interactive UI to gather the "key inputs" from the user.
Second, for the long-running callout, the developer should use an Apex method that returns a Continuation object (Option A) . Standard synchronous callouts in Salesforce have a timeout limit (typically 10 seconds, max 120) and, more importantly, they "hold" a thread in the Salesforce application server. If many users perform long callouts simultaneously, the org can hit the "Concurrent Request" limit, blocking other users. The Continuation class allows the request to be handed off to a specialized Salesforce service that waits for the response asynchronously. Once the external service responds, the Continuation service "wakes up" the Apex callback method. This pattern is essential for long-running integrations as it doesn't count against concurrent request limits while the external system is processing, providing a much more scalable user experience.
Question 252:
Refer to the markup below:
HTML
<template>
<lightning-record-form
record-id={recordId}
object-api-name="Account"
layout-type="Full">
</lightning-record-form>
</template>
A Lightning web component displays the Account name and two custom fields out of 275 that exist on the object. The custom fields are correctly declared and populated. However, the developer receives complaints that the component performs slowly.
What can the developer do to improve the performance?
A. Replace layout-type="Full" with fields={fields}. B. Add density="compact" to the component. C. Replace layout-type="Full" with layout-type="Partial". D. Add cache="true" to the component.
A. Replace layout-type="Full" with fields={fields}.
Explanation
The lightning-record-form is a powerful, high-level component that simplifies data entry and display. However, its performance is heavily influenced by the layout-type attribute. When layout-type="Full" is used, the component fetches and renders every single field defined on the object's "Full" page layout in the Salesforce metadata. In this case, the Account object has 275 fields. Fetching and rendering such a large volume of metadata and data causes a significant performance lag, even if the user only cares about three specific fields.
To improve performance, the developer should switch from a layout-based approach to a field-based approach. By removing the layout-type attribute and adding the fields attribute (Option A), the developer can pass an array of only the specific field API names required (e.g., ['Name', 'CustomField1__c', 'CustomField2__c']). This drastically reduces the amount of data requested from the Lightning Data Service (LDS) and minimizes the DOM elements the browser needs to render. Option C is incorrect because "Partial" is not a valid value for layout-type; the only supported values are "Full" and "Compact". Option B only affects the visual spacing of the fields and does not reduce the data load. Option A is the direct and most effective way to optimize component responsiveness by limiting the data scope.
Question 253:
A developer needs to store variables to control the style and behavior of a Lightning Web Component. Which feature should be used to ensure that the variables are testable in both Production and all Sandboxes?
A. Custom Metadata B. Custom Object C. Custom Setting D. Custom Variable
A. Custom Metadata
Explanation
For application configurations that control behavior and styling across different environments, Custom Metadata Types (Option A) are the industry-standard choice. The primary advantage of Custom Metadata over Custom Settings or Custom Objects is that the records themselves are treated as metadata. This means they can be deployed using Change Sets, Salesforce CLI, or packages. When a developer moves code from a Sandbox to Production, the associated configuration records are included in the deployment, ensuring that the Lightning Web Component behaves identically in both environments without manual data setup.
Furthermore, Custom Metadata is highly "testable." In Apex unit tests, you can query Custom Metadata records without needing the (SeeAllData=true) annotation. If your component's Apex controller logic depends on these variables, the tests will remain robust and environment-independent. Custom Settings (Option C) and Custom Objects (Option B) store records as data , which cannot be deployed via Change Sets and require manual entry or data loading in every new sandbox or production org, increasing the risk of configuration errors. Custom Metadata provides the most "extendable" and deployable way to manage component-level constants and behavioral flags.
Question 254:
A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?
A. Create a Before Save Flow, execute a Queueable job from it, and make a callout from the Queueable job. B. Create an Apex class, execute a Batch Apex job from it, and make a callout from the Batch Apex job. C. Create an Apex trigger, execute a Queueable job from it, and make a callout from the Queueable job. D. Create an Apex class, execute a Future method from it, and make a callout from the Future method.
C. Create an Apex trigger, execute a Queueable job from it, and make a callout from the Queueable job.
Explanation
The requirement is to perform a callout when a record is inserted. Because Salesforce prohibits synchronous callouts after DML operations in the same transaction, this must be handled asynchronously.
Queueable Apex (Option C) is the optimal choice for this integration. When an Account is inserted, a trigger captures the ID and enqueues a Queueable job. Queueable is superior to Future methods (Option D) because it supports complex data types (not just primitives), allows for job chaining, and provides a Job ID that can be used for monitoring via AsyncApexJob.
Before-Save Flows (Option A) cannot directly perform callouts, and while they can trigger asynchronous paths, the programmatic control offered by a Trigger-to-Queueable pattern is more robust for complex third- party integrations. Batch Apex (Option B) is designed for bulk processing of existing records and is "overkill" for a real-time, record-by-record trigger requirement. By using a Trigger with Queueable, the developer ensures the address validation happens nearly in real- time without blocking the user's initial save transaction or hitting concurrent request limits.
Question 255:
In which of the following scenarios would it be acceptable to use programmatic sharing instead of declarative sharing? (Choose three.)
A. Every record created by sales users needs to be visible to their respective manager B. Poor performance when using native sharing components C. Team functionality is required on custom objects D. There is an existing, external system of truth for user access assignments which will continue to drive access and be integrated with salesforce E. You need to change record access to read/write for all users utilising a lightning component
B. Poor performance when using native sharing components C. Team functionality is required on custom objects D. There is an existing, external system of truth for user access assignments which will continue to drive access and be integrated with salesforce
Question 256:
A developer has a page with two extensions overriding the standard controller for Case.
What will happen when a user clicks the command button?
A. All of the three Save methods will be executed B. Save from Case Standard Controller will be executed C. Save from CaseExtensionTwo will be executed D. Save from CaseExtensionOne will be executed
D. Save from CaseExtensionOne will be executed
Question 257:
A company has an Apex process that makes multiple extensive database operations and web service callouts. The database processes and web services can take a long time to run and must be run sequentially.
How should the developer write this Apex code without running into governor limits and system limitations?
A. Use Limits class to stop entire process once governor limits are reached. B. Use multiple @future methods for each process and callout. C. Use Queueable Apex to chain the jobs to run sequentially. D. Use Apex Scheduler to scheduled each process.
C. Use Queueable Apex to chain the jobs to run sequentially.
Explanation
This requirement specifies two critical constraints: the operations take a long time (likely exceeding synchronous CPU and timeout limits) and they must be performed sequentially .
Queueable Apex (Option C) is the optimal solution because it supports job chaining. Chaining allows one Queueable job to enqueue another Queueable job from its execute() method. This effectively creates a sequence where Job B only starts after Job A has successfully finished. Each job in the chain starts with a fresh set of governor limits, which is essential for "extensive database operations" and long-running callouts.
Option B (@future) is unsuitable because future methods cannot be chained; you cannot call one future method from another. Furthermore, the order in which multiple future methods execute is not guaranteed by the platform, violating the "sequential" requirement. Option D (Apex Scheduler) is intended for delayed or recurring tasks and is not designed for managing immediate sequential dependencies. Option A is a defensive coding practice but does not solve the underlying need to complete the work.
Queueable Apex provides the programmatic control needed to manage complex, multi-step asynchronous workflows safely.
Question 258:
A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses.
Which tool should the developer use?
A. Developer Console B. Force.com Migration Tool C. Workbench D. Force.com IDE
C. Workbench
Question 259:
Users complain that a page Is very slow to respond. Upon investigation, the query below Is found to perform slowly.
SELECT id, Name FROM Contact WHERE CustomField_c null;
Which two actions can a developer take to improve performance? (Choose Two)
A. Add a UMir dause to the query to reduce the number of records returned. B. Contact Salesforce customer support to create a custom index to include null values C. Make the CustomFleld__c field an External ID. D. Make the field CustomReW__c required because Salesforce field Indexes do not Include nulls.
A. Add a UMir dause to the query to reduce the number of records returned. D. Make the field CustomReW__c required because Salesforce field Indexes do not Include nulls.
Question 260:
Which interface needs to be implemented by a Lightning Component so that it may be displayed in modal dialog by clicking a button on a Lightning Record page?
A. Force: lightningQuickAction B. Lightning:editAction C. Lightning:quickAction D. Force:lightningEditAction
A. Force: lightningQuickAction
Explanation
In the Aura Component framework, "Quick Actions" are used to extend the functionality of the Salesforce UI, allowing developers to surface custom components in modal pop-ups from the "Buttons, Links, and Actions" section of an object.
To make an Aura component available as a Quick Action, it must implement the force:
lightningQuickAction (Option A) interface. When this interface is added to the <aura:component> tag, the component becomes selectable when creating a new "Action" for an object. When a user clicks the corresponding button on the record page, Salesforce automatically wraps the component in a standard modal dialog box.
If the requirement specifically calls for the modal to occupy more screen real estate, the developer can also use force:lightningQuickActionWithoutHeader, which removes the standard "Save" and "Cancel" buttons and the header, providing a blank canvas within the modal. Option C is incorrect as the prefix must be force:, which refers to the library of interfaces provided by the Lightning Experience container. Option B and D are not standard interfaces for this purpose. Implementing force:lightningQuickAction is the standard way to bridge custom Aura logic with the native Salesforce record page button functionality.
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.