Weekend Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: netbudy65

PDII Salesforce Certified Platform Developer II (Plat-Dev-301) Questions and Answers

Questions 4

When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console:

System.CalloutException: Unauthorized endpoint

Which recommended approach should the developer implement

to resolve the callout exception?

Options:

A.

Annotate the getkRFCatalogContents method with @Future (Callout-true),

B.

Change the access modifier for ERPCatalog from public to global.

C.

Use the SetHeader() method to specify Basic Authentication,

D.

Create a remote site setting configuration that includes the endpoint.

Buy Now
Questions 5

A company has reference data stored in multiple custom metadata records that represent default information and delete behavior for certain geographic regions.

When a contact is inserted, the default information should be set on the contact from the custom metadata records based on the contact's address information.

Additionally, if a user attempts to delete a contact that belongs to a flagged region, the user must get an error message.

Depending on company personnel resources, what are two ways to automate this?

Choose 2 answers

Options:

A.

Remote action

B.

Flow Builder

C.

Apex trigger

D.

Apex invocable method

Buy Now
Questions 6

A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter view state errors when using it in production.

What should the developer ensure to correct these errors?

Options:

A.

Ensure queries do net exceed governor limits,

B.

Ensure properties are marked as private,

C.

Ensure variables are marked as transient.

D.

Ensure profiles have access to the Visualforce page.

Buy Now
Questions 7

A developer is creating a Lightning web component that displays a list of records in a lightning-datatable. After saving a new record to the database, the list is not updating.

PDII Question 7

What should the developer change in the code above for this to

happen?

Options:

A.

Call rafrasnApex() ON this.dazta.

B.

Create a new variable to store the result and annotate it with @track.

C.

Create a variable to store the result and call refreshpex().

D.

Add the @track decorator to the data variable.

Buy Now
Questions 8

Consider the queries in the options below and the following Information:

* For these queries, assume that there are more than 200,000 Account records.

* These records Include soft-deleted records; that is, deleted records that are still in the Recycle Bin.

* There are two fields that are marked as External Id on the

Account. These fields are customer_Number_c and ERR_Key_ s.

Which two queries are optimized for large data volumes?

Choose 2 answers

Options:

A.

SELECT I4 FROM Account WHERE Name !— NULL

B.

SELECT 1d FROM Accounts WHERE Name != '°

AND Customer_Number_c- "ValueA’

C.

SELECT ID FROM Account WHRE id IN :aListVariable

D.

SELECT Id FROM Account WHERE Name != ‘ ‘AND IsDeleted = false

Buy Now
Questions 9

A developer is asked to look into an issue where a scheduled Apex is running into DML limits. Upon investigation, the developer finds that the number of records processed by the scheduled Apex has recently increased to more than 10,000.

What should the developer do to eliminate the limit exception error?

Options:

A.

Use the @future annotation.

B.

Implement the Qususabls interface.

C.

Implement the Batchable interface.

D.

Use platform events.

Buy Now
Questions 10

Consider the following code snippet:

PDII Question 10

How should the component communicate to the

component that an order has been selected by the user?

Options:

A.

Create and fire a component event.

B.

Create and fire an application event.

C.

Create and fire a standard DOM event.

D.

Create and dispatch a custom event,

Buy Now
Questions 11

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?

Options:

A.

The record can be shared using an Apex class.

B.

The record can be shared using a permission set.

C.

The record can be shared using a sharing rule.

D.

The record cannot he shared with the current setup.

Buy Now
Questions 12

A company has code to update a Request and Request Lines and make a callout to

their external ERP system's REST endpoint with the updated records.

PDII Question 12

The callousUtil.makeRestCallout fails with a "You have uncommitted work pending. Please commit or rollback before calling cut’ error.

What should be done to address the problem?

Options:

A.

Change the callousUtil makeRestCallout to an @InvocsblsMethod method.

B.

Remove the Database. setSavepoint and Database. rollback.

C.

Change the CallousUtill .makeRestCallout to an @future method.

Buy Now
Questions 13

A company wants to run different logic based on an Opportunity's record type.

Which code segment handles this request and follows best practices?

A)

PDII Question 13

B)

PDII Question 13

C)

PDII Question 13

D)

PDII Question 13

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 14

Which three actions must be completed in a Lightning web component for a JavaScript file In a static resource to be loaded? Choose 3 answers

Options:

A.

Import the static resource.

B.

Reference the static resource in a <script> tag.

C.

Call loadScript.

D.

Import a method from the platformResourceLoader.

E.

Append the static resource to the DOM.

Buy Now
Questions 15

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 2 answers

Options:

A.

Lightning web component

B.

2 Apex method that returns a Continuation object

C.

Screen Flow

D.

Process Builder

Buy Now
Questions 16

A developer built an Aura component for guests to self-register upon arrival at a front desk kiosk. Now the developer needs to create a component for the utility tray to alert users whenever a guest arrives at the front desk.

What should be used?

Options:

A.

DML Operation

B.

Changelog

C.

Application Event

D.

Component Event

Buy Now
Questions 17

Which use case can be performed only by using asynchronous Apex?

Options:

A.

Querying tens of thousands of records

B.

Making a call to schedule a batch process to complete in the future

C.

Calling a web service from an Apex trigger

D.

Updating a record after the completion of an insert

Buy Now
Questions 18

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.

PDII Question 18

How should a developer change the component to be responsive for mobile and tablet devices?

A)

PDII Question 18

B)

PDII Question 18

C)

PDII Question 18

D)

PDII Question 18

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 19

When developing a Lightning web component, which setting displays lightninglayout-items im one column on small devices, such as mobile phones, and in two

columns on tablet-size and desktop-size screens?

Options:

A.

Set size="12" tablet-device-size="6"

B.

Set size="12" medium-device-size="6"

C.

Set size="6" mobile-device-size="12"

D.

Set size="6" small-device-size="12"

Buy Now
Questions 20

Refer to the test method below''

PDII Question 20

The test method calls a web service that updates an external system with Account

information and sets the Accounts integration_Updated__c checkbox to True when it completes.

The test fails to execute and exits with an error: "Methods defined as TestMethod do

not support Web service callouts.”

A)

PDII Question 20

B)

PDII Question 20

C)

PDII Question 20

D)

PDII Question 20

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 21

Universal Containers has an Apex trigger on Account that creates an Account Plan record when an Account is marked as a Customer.

Recently a record-triggered flow was added so that whenever an Account is marked as a Customer, a "Customer Since’ date field is updated with today's date. Since the addition of the flow, two Account Plan records are created whenever the Account is marked as a Customer.

What might cause this to happen?

Options:

A.

The Apex trigger does not use a static variable to ensure it only fires once.

B.

The flow is configured to use an "Update Records’ element.

C.

The Apex trigger is not bulk safe and calls insert inside of a for loop.

D.

The flow is configured to evaluate when a record is created and every time it is edited.

Buy Now
Questions 22

A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high value. Current criteria for an opportunity

to be considered high value is an amount greater than or equal to $1,000,000. However, this criteria value can change over time.

There is a new requirement to also display high value opportunities in a Lightning web component.

Which two actions should the developer take to meet these business requirements, and also prevent the business logic that obtains the high value opportunities from

being repeated in more than one place?

Choose 2 answers

Options:

A.

Call the trigger from the Lightning web component.

B.

Create a helper class that fetches the high value opportunities,

C.

Leave the business logic code inside the trigger for efficiency.

D.

Use custom metadata to hold the high value amount.

Buy Now
Questions 23

In an organization that has multi-currency enabled, a developer Is tasked with building a Lighting component that displays the top ten Opportunities most recently accessed by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale.

What is the most effective approach to ensure values displayed respect the user's locale settings?

Options:

A.

Use REGEX expressions to format the values retrieved via SOQL.

B.

Use a wrapper class to format the values retrieved via SOQL.

C.

Use the FOR VIEW clause in the SOQL query.

D.

Use the FORMAT () function in the SOQL query.

Buy Now
Questions 24

How should a developer assert that a trigger with an asynchronous process has successfully run?

Options:

A.

Create all test data in the test class, use system. runs {} to invoke the trigger, then perform assertions.

B.

Insert records into Salesforce, use seeAllData=true, then perform assertions.

C.

Create all test data, use future in the rest class, then perform assertions.

D.

Create all test data in the test class, invoke Test.startTest{} and Test.etopTaat {} and then perform assertions.

Buy Now
Questions 25

Refer to the Aura component below:

PDII Question 25

A developer receives complaints that the component loads slowly.

Which change can the developer implement to make the component perform faster?

Options:

A.

Change the type of contactInfo to "Map”.

B.

Move the contents of

C.

Add a change event handler for showContactInfo.

D.

Change the default for showContactInfo to “False.

Buy Now
Questions 26

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the

user.

The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, "Maximum view state size limit exceeded”.

What step should the developer take to resolve this issue?

Options:

A.

Adjust any code that filters by picklist values since they are not indexed,

B.

Remove instances of the transient keyword from the Apex controller to avoid the view state error.

C.

Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time.

D.

Split the layout to filter records in one Visualforce page and display the list of records in a second page using the same Apex controller.

Buy Now
Questions 27

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?

Options:

A.

Use Queueable Apex to chain the jobs to run sequentially.

B.

Use Apex Scheduler to schedule each process.

C.

Use multiple 3zutuze methods for each process and callout.

D.

Use Limits class to stop entire process once governor limits are reached.

Buy Now
Questions 28

Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers’ sales representatives can edit the orders on the same Visualforce page.

What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?

Options:

A.

use System. profiles=() to test as a sales rep and a community user.

B.

use System. profiles() to test as an administrator and a community user.

C.

use System. profiles1h=() to test as a sales rep and a community user.

D.

use System. runsAs () to test as an administrator and a community user.

Buy Now
Questions 29

A developer is asked to find a way to store sacret data with an ability to specify which profiles and users can access which secrets.

What should be used to store this data?

Options:

A.

system.Cookie class

B.

Custom settings

C.

Static resources

D.

Custom metadata

Buy Now
Questions 30

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?

A)

PDII Question 30

B)

PDII Question 30

C)

PDII Question 30

D)

PDII Question 30

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 31

How can a developer efficiently incorporate multiple JavaScript libraries in an Aura component?

Options:

A.

Use JavaScript remoting and script tags.

B.

Use CDNs with script attributes.

C.

Implement the libraries in separate helper files.

D.

Join multiple assets from a static resource.

Buy Now
Questions 32

An environment has two Apex triggers: an after-update trigger on Account and an after-update trigger on Contact.

The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state.

Consider the following: A mass update of 200 Account records’ addresses, where each Account has 50 Contacts. Each Contact has one Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.

What will happen when the mass update occurs?

Options:

A.

There will be no error and all updates will succeed, since the limit on the number of records processed by DML statements was not exceeded.

B.

The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements.

C.

There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML statements.

D.

The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.

Buy Now
Questions 33

A developer gets an error saying ‘Maximum Trigger Depth Exceeded.’

What is a possible reason to get this error message?

Options:

A.

A trigger is recursively invoked more than 16 times.

B.

The SOQL governor limits are being hit.

C.

There are numerous DML operations in the trigger logic.

D.

A flow trigger was included too many times.

Buy Now
Questions 34

Refer to the test method below:

PDII Question 34

The test method tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.

The test method fails at the Line 20 because of too many SOQL queries.

What is the correct way to fix this?

Options:

A.

PDII Question 34 Option 1

B.

34

C.

34

D.

34

Buy Now
Questions 35

A developer needs to store variables to control the style and behavior of a Lightning Web Component.

Which feature can be used to ensure that the variables are testable in both Production and all Sandboxes?

Options:

A.

Custom setting

B.

Custom object

C.

Custom variable

D.

Custom metadata

Buy Now
Questions 36

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

Options:

A.

Custom object

B.

Custom metadata

C.

Hierarchy custom setting

D.

List custom setting

Buy Now
Questions 37

A developer creates an application event that has triggered an infinite loop.

What may have caused this problem?

Options:

A.

The event is fired from a custom renderer.

B.

The event has multiple handlers registered in the project.

C.

The event handler calls a trigger.

D.

An event is fired ‘ontouchend'’ and is unhandled.

Buy Now
Questions 38

A developer created 2 class that implements the Queueable Interface, as follows:

PDII Question 38

As part of the deployment process, the developer is asked to create a corresponding test class.

Which two actions should the developer take to successfully execute the test class?

Choose 2 answers

Options:

A.

Implement seeAllData=True to ensure the Queueable job is able to run in bulk mode.

B.

Ensure the running user of the test class has, at I the View All permission on the Order object.

C.

Enclose System.enqueueJob(new OrderQueueableJob ()] within Tess. and Test .stopTest (1.

D.

Implement Test. isRunningTest() to prevent chaining jobs during test execution.

Buy Now
Questions 39

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?

Options:

A.

Use Database methods to obtain lists of Database.SaveResults.

B.

Use a try-catch statement and handle DML cleanup in the catch statement,

C.

Use Database.setSavepoint {} and Database.rollBack with a try-catch statement.

D.

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

Buy Now
Questions 40

Which two queries are selective SOQL queries and can be used for a large data set of 200,000 Account records?

Choose 2 answers

Options:

A.

SELECT Id FROM Account WHERE Name LIKE '!-NULL

B.

SELECT Id FRCM Account WHERE Name != ’ ’

C.

SELECT Id FRCM Account WHEP Name IN (List of Names) AND Customer_Number_c= 'ValueA

D.

SELECT Id FROM Account WHERE II IK (List of Account Ida)

Buy Now
Questions 41

A developer has a requirement to query three fields (Id, Name, Type) from an Account; and first and last names for all Contacts associated with the Account.

Which option is the preferred, optimized method to achieve this for the Account named ‘Ozone Electronics’?

A)

PDII Question 41

B)

PDII Question 41

C)

PDII Question 41

D)

PDII Question 41

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 42

A user receives the generic "An internal server error has occurred” while interacting

with a custom Lightning component.

What should the developer do to ensure a more meaningful message?

Options:

A.

Add an onerror event handler to the tag.

B.

Add an error-view component to the markup.

C.

Use platform events to process the error

D.

Use an AuraHandledexception in a try-catch block.

Buy Now
Questions 43

A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org from which a user will select. An Apex method prepares and returns data to the component.

What should the developer do to determine which objects to include in the response?

Options:

A.

Check the isCustom() value on the sObject describe result,

B.

Import the list of all custom objects from @salesforce/schema.

C.

Check the getobiectType [) value for ‘Custom’ or "Standard’ on the sObject describe result.

D.

Use the getcustomobjects() method from the Schema class.

Buy Now
Questions 44

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.

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

B.

After triggers fire before workflow rules.

C.

Trigger.new does not change after a field update.

D.

After triggers are not fired after field updates.

Buy Now
Questions 45

What should a developer use to query all Account fields for the Acme account in their sandbox?

Options:

A.

SELECT FIELDS FAOM Account WHERE Name = ‘Acme’ LIMIT 1

B.

SELECT FIELDS (ALL) FROM Account WHERE Name = ‘Acme’ LIMIT 1

C.

SELECT ALL FROM Account WHERE Name = "Acme’ LIMIT 1

D.

SELECT * FROM Recount WHERE Names = ‘Aeme’ LIMIT 1

Buy Now
Questions 46

A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.

What can a developer to do address the issue?

Options:

A.

Turn off triggers, flows, and validations when running tests.

B.

Move the prerequisite reference data setup to a TestDataFactory and call that from each test method,

C.

Move the prerequisite reference data setup to a @testSetup method in the test class.

D.

Move the prerequisite reference data setup to the constructor for the test class.

Buy Now
Questions 47

Refer to the Lightning component below:

PDII Question 47

The Lightning Component allows users to click a button to save their changes and then redirects them to a different page.

Currently when the user hits the Save button, the records are getting saved, but they are not redirected.

Which three techniques can a developer use to debug the JavaScript?

Choose 3 answers

Options:

A.

Use console.log () messages in the JavaScript.

B.

Use the browser's dev tools to debug the JavaScript.

C.

Enable Debug Mode for Lightning components for the user.

D.

Use Developer Console to view checkpoints.

E.

Use Developer Console to view the debug log.

Buy Now
Questions 48

A developer created the following test method:

PDII Question 48

The developer org has five accounts where the name starts with “Test”. The developer executes this test in the Developer Console.

After the test code runs, which statement is true?

Options:

A.

The test will fail.

B.

There will be no accounts where the name starts with "Test".

C.

There will be five accounts where the name starts with "Test".

D.

There will be six accounts where the name starts with "Test".

Buy Now
Questions 49

A developer has a Visualforce page that automatically assigns ewnership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.

What can cause this problem?

Options:

A.

The test class does not retrieve the updated value from the database,

B.

The test class does not use the Bulk API for loading test data.

C.

The test class does not use the seeallData=true= annotation.

D.

The test class does not implement the Queueable interface.

Buy Now
Questions 50

Instead of waiting to send emails to support personnel directly from the finish

method of a batch Apex process, Universal Containers wants to notify an external

system in the event that an unhandled exception occurs.

What is the appropriate publish/subscribe logic to meet this requirement?

Options:

A.

Publish the error event using the Eventbus. publish () method.

B.

No publishing is necessary. Have the external system subscribe to the BatchapexErrorEvent.

C.

Publish the error event using the addError method.

D.

Publish the error event with a Flow.

Buy Now
Exam Code: PDII
Exam Name: Salesforce Certified Platform Developer II (Plat-Dev-301)
Last Update: Sep 23, 2025
Questions: 202

PDF + Testing Engine

$140

Testing Engine

$105

PDF (Q&A)

$90