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 341:
A business process requires sending new Account records to an external system. The Account Name, Id, CreatedDate, and CreatedById must be passed to the external system in near real-time when an Account is inserted without error.
How should a developer achieve this?
A. Use a before insert trigger and an @future method. B. Use a before insert trigger and a Queueable class. C. Use a Process Builder that calls an @InvocableMethod method. D. Use a Workflow rule that calls an @InvocableMethod method.
C. Use a Process Builder that calls an @InvocableMethod method.
Question 342:
A company has a custom object, Request_c, that has a checkbox field, Completed_c, and a Lookup to Opportunity, Opportunity_c.
Which SOQL query will get a unique list of all of the Opportunity records that have a Completed Request?
A. SELECT Opportunity_c FROM Request_c WHERE Id IN (SELECT Id FROM Request_c Where Completed_c = true) B. SELECT Opportunity_c FROM Request_c WHERE Completed_c = true C. SELECT Id FROM Opportunity WHERE Id IN (SELECT Id FROM Request_c WHERE Completed = true) D. SELECT Id From Opportunity WHERE Id IN (SELECT Opportunity_c FROM Request_c WHERE Completed_c = true)
D. SELECT Id From Opportunity WHERE Id IN (SELECT Opportunity_c FROM Request_c WHERE Completed_c = true)
Question 343:
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production.
What should the developer ensure to correct these errors?
A. Ensure queries do not exceed governor limits. B. Ensure properties are marked as Transient. C. Ensure properties are marked as private. D. Ensure profiles have access to the Visualforce page.
B. Ensure properties are marked as Transient.
Explanation
The Visualforce View State is a hidden form field that maintains the state of the page (including controller variables) between server requests. Salesforce imposes a strict 135KB limit on the View State. When a page handles large amounts of 10data--such as large lists of records or complex objects--the serialized size of the controller variables can easily exceed this limit, resulting in a runtime error for the user.
To correct these errors, the developer should use the transient keyword (Option B). Marking a variable as transient prevents it from being serialized into the View State. This is the standard best practice for any data that does not need to be maintained across "postbacks" (actions that refresh the page or part of the page).
Common candidates for the transient keyword include:
Large lists of records retrieved for display only.
Temporary variables used for calculations during a single request.
Summary data that can be easily re-queried if needed.
Option D relates to security, not performance. Option C (private variables) does not exclude variables from the View State; only static and transient variables are excluded. Option A relates to SOQL governor limits, which are independent of the View State size. By judiciously using transient, the developer keeps the page weight low and ensures a smooth user experience in production environments with real-world data volumes.
Question 344:
A company uses a custom-built enterprise resource planning (ERP) system to handle order management. The company wants Sales Reps to know the status of orders so that if a customer calls to ask about their shipment, the Sales Rep can advise the customer about the order's status and tracking number if it is already shipped.
Which two methods can make this ERP order data visible in Salesforce? (Choose two.)
A. Ensure real-time order data is in Salesforce using the Streaming API. B. Write a cron job In Salesforce to poll the ERP system for order updates. C. Have the ERP system push the data into Salesforce using the SOAP API. D. Use Salesforce Connect to view real-time Order data in the ERP system.
C. Have the ERP system push the data into Salesforce using the SOAP API. D. Use Salesforce Connect to view real-time Order data in the ERP system.
Question 345:
What is the correct order of execution for Visualforce page GET requests (initial page visit)?
A. 1) Evaluate constructors on controller and extensions2) If there's a <apex:form> element, create the view state3) Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page4) Evaluate constructors, extensions, and expression on attribute definitions on any custom components present5) Send HTML to the browser B. 1)Evaluate constructors, extensions, and expression on attribute definitions on any custom components present2) Evaluate constructors on controller and extensions3) Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page4) If there is an <apex:form> element, create the view state5) Send HTML to the browser C. 1)Evaluate constructors on controller and extensions2) Evaluate constructors, extensions, and expression on attribute definitions on any custom components present3) Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page4) If there is an <apex:form> element, create the view state5) Send HTML to the browser
C. 1)Evaluate constructors on controller and extensions2) Evaluate constructors, extensions, and expression on attribute definitions on any custom components present3) Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page4) If there is an <apex:form> element, create the view state5) Send HTML to the browser
Question 346:
A developer is asked to find a way to store secret data with an ability to specify which profiles and users can access which secrets.
What should be used to store this data?
A. Static resources B. Custom settings C. Custom metadata D. System.Cookie class
B. Custom settings
Explanation
When a requirement involves storing configuration or "secret" data that needs to vary based on the specific user or profile, Hierarchy Custom Settings (Option B) are the correct choice. Unlike Custom Metadata (Option C), which is available to the entire organization regardless of the user, Hierarchy Custom Settings use a built-in logic to provide values based on the "most specific" level defined.
The hierarchy follows a specific order: User > Profile > Organization. If a secret key is defined at the User level, that value is returned for that specific user. If not, the system looks for a value defined at the user's Profile level, and finally falls back to the Organization-wide default. This allows a developer to store sensitive keys or flags and restrict or vary them dynamically based on the current user's identity.
Custom Metadata is better suited for application-wide configurations that need to be deployable via packages, but it lacks the granular per-user/per-profile override capability inherent to Hierarchy Custom Settings. Static Resources (Option A) are public to anyone with access to the resource, and Cookies (Option D) are stored on the client side, making them insecure for "secret" data. Therefore, Custom Settings provide the best balance of security and hierarchical flexibility for this use case.
Question 347:
Ursa Major Solar has a custom object, serviceJcb__c, with an optional Lookup field to Account called Partr,er_service_Provid__c.
The TocaUobs__c field on Account tracks the total number of serviceJcb__o records to which a partner service provider Account is related.
What should be done to ensure that the TotalJobs_c field is kept up to date?
A. Build a Process Builder with an invocable action. B. Create an Apex trigger on serviceJob__c C. Implement a workflow cross-object field update. D. Change TotalJobi__a to a roll-up summary field.
B. Create an Apex trigger on serviceJob__c
Question 348:
A developer wants to call an Apex Server-side Controller from a Lightning Aura Component. What are two limitations to the data being returned by the Controller? (Choose Two)
A. A Lists of Custom Apex Classes cannot be returned by Apex Controllers called by Lightning Aura Components. B. Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to. C. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned. D. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.
B. Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to. C. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.
Question 349:
Universal Containers (UC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish-speaking customers also. US heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site.
What should the developer use to ensure the site is multilingual?
A. Use Custom Settings to ensure custom messages are translated properly. B. Use Custom Labels to ensure custom messages are translated property. C. Use Custom Metadata to translate custom picklist values. D. Use Custom Objects to translate custom picklist values.
B. Use Custom Labels to ensure custom messages are translated property.
A developer creates a Lightning web component to allow a Contact to be quickly entered. However, error messages are not displayed.
Which component should the developer add to the form to display error messages?
A. lightning-messages B. aura:messages C. lightning-error D. apex:messages
A. lightning-messages
Explanation
The lightning-record-edit-form is a powerful LWC component that automates record creation and editing. It handles field-level security, metadata retrieval, and data persistence automatically. However, for a complete user experience, it requires specific sub-components to handle feedback. While lightning-input-field handles inline validation (like a missing required field), it does not automatically display "top-level" error messages, such as validation rule failures or system errors returned from the server.
To display these errors, the developer must include the lightning-messages (Option A) component inside the lightning-record-edit-form tags. When a form submission fails, the lightning-messages component automatically catches the error payload returned by the Lightning Data Service and renders it in a user- friendly format at the top of the form (or wherever it is placed).
Option C is not a standard Base Lightning Component name. Options B and D belong to the Visualforce and Aura frameworks, respectively, and cannot be used within a Lightning Web Component template. Including lightning-messages is a required step for any robust implementation of lightning-record-edit-form to ensure users are informed of why a record could not be saved.
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.