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 101:
The Contact object in an org is configured with workflow rules that trigger field updates. The fields are not updating, even though the end user expects them to. The developer creates a debug log to troubleshoot the problem.
What should the developer specify in the debug log to see the values of the workflow rule conditions and debug the problem?
A. INFO level for the Database log category B. ERROR level for the Workflow log category C. ERROR level for the Database log category D. INFO level for the Workflow log category
A. INFO level for the Database log category
Question 102:
A company recently deployed a Visualforce page with a custom controller that has a data grid of information about Opportunities in the org. Users report that they receive a "Maximum view state size limit" error message under certain conditions.
According to Visualforce best practice, which three actions should the developer take to reduce the view state? (Choose three.)
A. Use the transient keyword in the Apex controller for variables that do not maintain state B. Use the final keyword in the controller for variables that will not change C. Use the private keyword in the controller for variables D. Refine any SOQL queries to return only data relevant to the page E. Use filters and pagination to reduce the amount of data
A. Use the transient keyword in the Apex controller for variables that do not maintain state D. Refine any SOQL queries to return only data relevant to the page E. Use filters and pagination to reduce the amount of data
Explanation
The Visualforce View State holds the state of the page (including controller variables) between server requests. It has a strict limit of 135KB. When a page handles large sets of data, like a grid of Opportunities, the view state can easily exceed this limit.
Transient Keyword (Option A): This is the most effective programmatic way to reduce view state. Marking a variable as transient prevents it from being serialized into the view state. This should be used for any data that is only needed for the current request and does not need to be maintained during a postback (e.g., large lists of records retrieved for a single display).
Filters and Pagination (Option E): By using a StandardSetController or custom offset logic, the developer can limit the number of records held in memory at any given time. Instead of loading 5,000 Opportunities, the page can load and store only 20 records per page.
Refine SOQL Queries (Option D): Developers often query "all" fields (e.g., SELECT * equivalent) or include large text areas that aren't displayed. By selecting only the specific fields required for the grid, the size of each object in the collection is reduced, directly lowering the view state.
Option B and C (private and final) affect variable visibility and immutability but do not prevent the variables from being serialized into the view state.
Question 103:
The test method above calls an @future method that increments the Number_of_Times_Viewed__c value. The assertion is failing because the Number_of_Times_Viewed__c equals 0. What is the optimal way to fix this?
@isTest
static void testIncrement() {
Account acct = new Account(Name = 'Test', Number_Of_Times_Viewed__c = 0);
insert acct;
AuditUtil.incrementViewed(acct.Id); // This is the @future method
Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0];
A. Change the initialization to acct.Number_Of_Times_Viewed__c = 1. B. Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c). C. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed. D. Add Test.startTest() before and Test.stopTest() after insert acct
C. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
Explanation
Asynchronous methods, such as those annotated with @future, do not run immediately when called in Apex. Instead, they are added to a queue to be processed when system resources become available. In a unit test, if you call a future method and immediately query the database for the result, the future method likely hasn't executed yet, resulting in the "0" value observed in the assertion.
To test asynchronous code, you must wrap the call within Test.startTest() and Test.stopTest() (Option C) . When the code reaches Test.stopTest(), the execution of the test script pauses, and the system forces all queued asynchronous jobs (future methods, batch jobs, queueable jobs) to run to completion synchronously. By placing the AuditUtil.incrementViewed(acct.Id) call inside this block, you ensure that by the time the next line of code (the SOQL query) runs, the increment logic has finished and the database reflects the new value. Option D is incorrect because inserting the account is a synchronous operation that doesn't require the stopTest wait. Option A and B avoid the problem rather than testing the logic correctly. Option D is the standard platform-required pattern for testing asynchronous side effects.
Question 104:
Universal Containers needs to integrate with their own, existing, internal custom web application. The web application accepts JSON payloads, resizes product images, and sends the resized images back to Salesforce.
What should the developer use to implement this integration?
A. A workflow rule with an outbound message that contains a session ID B. An Apex trigger that calls an @future method that allows callouts C. A platform event that makes a callout to the web application D. A flow that calls an @future method that allows callouts
B. An Apex trigger that calls an @future method that allows callouts
Explanation
This integration requirement involves two specific needs: sending a custom JSON payload and handling a response that involves updating data in Salesforce. Outbound Messaging (Option A) is a declarative tool, but it is limited to XML/SOAP protocols and cannot send JSON. Therefore, a custom programmatic solution using Apex is required to construct and send the JSON payload to the external REST service.
Since the integration must be triggered by an event in Salesforce (likely the upload or update of a product record), an Apex trigger is the most direct starting point. However, as noted in previous questions, callouts cannot be performed directly within a trigger's execution context because they would block the database transaction. The developer must use asynchronous processing to handle the callout. An @future(callout=true) method is the standard way to achieve this. The trigger captures the necessary data, passes it to the future method, and the future method then performs the HTTP request to the external application.
Once the external application resizes the image, it can use the Salesforce REST API to send the resized file back to Salesforce. While Platform Events (Option C) are a modern alternative for event-driven architectures, they would still require an asynchronous subscriber (like a trigger or a flow) to actually perform the callout, making the Trigger + Future method combination the most straightforward and traditional answer for this PDII scenario.
Question 105:
A developer is creating a page in App Builder that will be used in the Salesforce mobile app.
Which two practices should the developer follow to ensure the page operates with optimal performance? (Choose Two)
A. Limit five visible components on the page. B. Limit 25 fields on the record detail page. C. Limit the number of Tabs and Accordion components. D. Analyze the page with Performance Analysis for App Builder.
B. Limit 25 fields on the record detail page. D. Analyze the page with Performance Analysis for App Builder.
Question 106:
An Aura component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the description field output on their mobile devices and tablets.
Which option has the changes to make the component responsive for mobile and tablet devices?
A. Option A B. Option B C. Option C D. Option D
C. Option C
Explanation
To create a responsive design in Salesforce Aura components, the lightning:layout and lightning:layoutItem components use a 12-column grid system based on the Salesforce Lightning Design System (SLDS). The issue in the original code is that size="6" is hardcoded, which forces each item to occupy 50% of the container width regardless of screen size. On small mobile screens, a 50% width is often insufficient for text content, leading to horizontal scrolling or overlapping.
Option C resolves this issue by using device-specific size attributes. By setting smallDeviceSize="12", each item takes up the full width (12 out of 12 columns) on mobile devices. This causes the items to stack vertically instead of appearing side by side. The mediumDeviceSize="6" and largeDeviceSize="6" attributes ensure that on tablets and desktop screens, the items return to a side-by-side layout, with each item occupying 50% of the width.
For this stacking behavior to occur, the parent lightning:layout must have the multipleRows="true" attribute enabled. This allows the layout to wrap items onto a new line once the total column count in a single row exceeds 12. Without multipleRows="true", the items would attempt to remain on a single line regardless of their individual size settings, which would not resolve the horizontal scrolling issue. Option C is the only choice that correctly applies the grid logic to handle multiple breakpoints effectively.
Question 107:
A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup.
What are three actions to enable this functionality? (Choose three.)
A. Surround the callout with TeststartTest(), Test.stopTest() B. Surround the data insertion with Test.startTest(), Test.stopTest() C. Implement the WebServiceMock interface D. Update code to call Test.setMock() E. Implement the HttpCalloutMock interface
A. Surround the callout with TeststartTest(), Test.stopTest() C. Implement the WebServiceMock interface D. Update code to call Test.setMock()
Users of this Visualforce page complain that the page does a full refresh every time the Search button is pressed.
What should the developer do to ensure that a partial refresh is made so that only the section identified with opportunity List is re-drawn on the screen?
A. Ensure the lotion method search returns null. B. Implement the rerendered attribute on the <apex:commandButton>tag. C. Enclose the DATA table within the <apex:actionRegion> tag. D. Implement the <apex:actionFunction> tag with immediate = true.
B. Implement the rerendered attribute on the <apex:commandButton>tag.
Explanation
In Visualforce, the standard behavior for an <apex:commandButton> is to perform a full page postback. To convert this into an asynchronous (AJAX) request that only updates a specific portion of the page, the developer must use the reRender attribute (Option B) . By setting reRender="opportunityList" on the command button, the developer instructs the platform to capture the server's response and update only the DOM element with that specific ID, rather than refreshing the entire browser window.
While Option A (returning null from the search method) is a requirement for staying on the same page, it does not prevent the full refresh by itself. Option C (<apex:actionRegion>) is used to limit which part of the form's data is sent to the server for processing (to avoid validation errors on unrelated fields), but it does not control which part of the page is re-drawn on the client. Option D (<apex:actionFunction>) is a way to call Apex from JavaScript but doesn't solve the button's refresh behavior directly.
Implementing reRender is the standard and most efficient way to achieve the "partial refresh" UX in Visualforce, significantly improving the perceived performance and user experience by reducing the amount of data and UI flickering during search operations.
Question 109:
Which statement is true regarding both Flow and Lightning Process? (Choose two.)
A. Can use Apex methods with the @InvocableMethod annotation B. Are both server-side considerations in the Order of Execution C. Can use Apex that implements the Process.Plugin interface D. Are able to be embedded directly into Visualforce pages
A. Can use Apex methods with the @InvocableMethod annotation B. Are both server-side considerations in the Order of Execution
Question 110:
For compliance purposes, a company is required to track long-term product usage in their org. The information that they need to log will be collected from more than one object and, over time, they predict they will have hundreds of millions of records.
What should a developer use to implement this?
A. Field Audit Trail B. Setup Audit Trail C. Field History Tracking D. Big objects
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.