Big Black Friday Sale 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sale65best

Free Salesforce PDII Practice Exam with Questions & Answers

Questions 1

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?

Options:
A.

Use the transient keyword in the Apex controller for variables that do not maintain state.

B.

Use the private keyword in the controller for variables.1415

C.

Use the final keyword in the controller for variables that will not change.1617

D.

Use filters and pagination to reduce the amount of data.1819

E.

Refine any SOQL queries to return only data relevant to the page.2021

Salesforce PDII Premium Access
Questions 2

A Visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?

Options:
A.

Use the transient keyword for the List variables used in the custom controller.

B.

Use lazy loading to load the data on demand, instead of in the controller's constructor.

C.

Use JavaScript to move data processing to the browser instead of the controller.

D.

Use an <apex:actionPoller> in the page to load all of the data asynchronously.

Questions 3

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 within the xml resource file?

Options:
A.

Set the 'IsVisible' attribute to 'true'.

B.

Set the 'IsExposed' attribute to 'true'.

C.

Specify the 'target' to be 'lightning__RecordPage'.

D.

Specify the 'target' to be 'lightning__AppPage'.

Questions 4

A developer wrote the following method to find all the test accounts in the org:

Java

public static Account[] searchTestAccounts() {

List> searchList = [FIND 'test' IN ALL FIELDS RETURNING Account(Name)];

return (Account[]) searchList[0];

}

However, the test method below fails.

Java

@isTest

public static void testSearchTestAccounts() {

Account a = new Account(name='test');

insert a;

Account [] accounts = TestAccountFinder.searchTestAccounts();

System.assert(accounts.size() == 1);

}

What should be used to fix this failing test?

Options:
A.

@isTest(SeeAllData=true) to access org data for the test9

B.

Test.loadData to set up expected data10

C.

Test.setFixedSearchResults() method to set up expected data11

D.

@testSetup method to set up expected data12

Questions 5

A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process. During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll back to SP3 is called, a runtime error occurs. Why does the developer receive a runtime error?

Options:
A.

The developer has too many DML statements between the savepoints.

B.

SP3 became invalid when SP1 was rolled back.

C.

The developer should have called SP2 before calling SP3.

D.

The developer used too many savepoints in one trigger session.

Questions 6

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?4647

Options:
A.

Batch Apex4849

B.

Lightning web component5051

C.

Screen Flow5253

D.

Apex method that returns a Continuation object5455

Questions 7

Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called Candidate was created with organization-wide defaults set to Private. A lookup on the Candidate object sets an employee as an Interviewer. What should be used to automatically give Read access to the record when the lookup field is set to the Interviewer user?12345

Options:
A.

The record can be shared using an Apex class.678910

B.

The record can be shared using a permission set.1112131415

C.

The record can be shared using a sharing rule.1617181920

D.

The record cannot be shared with the current setup.2122232425

Questions 8

An Apex trigger creates a Contract record every time an Opportunity is marked as Closed/Won. Historical records need to be loaded, but Contract records should not be created during this mass load. What is the most extendable way to update the Apex trigger to accomplish this?

Options:
A.

Add the Profile ID of the user who loads the data to the trigger.

B.

Add a validation rule to the Contract to prevent creation by the data load user.

C.

Use a list custom setting to disable the trigger for the user who loads the data.

D.

Use a hierarchy custom setting to skip executing the logic inside the trigger for the user who loads the data.

Questions 9

A developer is working with existing functionality that tracks how many times a stage has changed for an Opportunity. When the Opportunity's stage is changed, a workflow rule is fired to increase the value of a field by one. The developer wrote an after trigger to create a child record when the field changes from 4 to 5. A user changes the stage of an Opportunity and manually sets the count field to 4. The count field updates to 5, but the child record is not created. What is the reason this is happening?

Options:
A.

After triggers fire before workflow rules.

B.

Trigger.new does not change after a field update.

C.

Trigger.old does not contain the updated value of the count field.

D.

After triggers are not fired after field updates.

Questions 10

A developer is inserting, updating, and deleting multiple lists of records in a single transaction and wants to ensure that any error prevents all execution. How should the developer implement error exception handling in their code to handle this?1234567

Options:
A.

Use Database methods to obtain lists of Database.SaveResults.

B.

Use Database.setSavepoint() and Database.rollBack() with a try-catch statement.

C.

Use a try-catch statement and handle DML cleanu22p in the catch statement.

D.

Us29e a try-catch and use sObject.addError() on any failures.

Exam Code: PDII
Certification Provider: Salesforce
Exam Name: Salesforce Certified Platform Developer II ( Plat-Dev-301 )
Last Update: Jan 19, 2026
Questions: 161