Summer Sale - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 65percent

Welcome To DumpsPedia

PDII Sample Questions Answers

Questions 4

A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes. Which tool or mechanism should be utilized for managing the source-driven deployment process?78

Options:

A.

Data Loader910

B.

Change Sets1112

C.

Salesforce CLI with Salesforce DX1314

D.

Unmanaged Packages1516

Buy Now
Questions 5

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 do to address the issue?

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 6

A company needs to automatically delete sensitive information after seven years. This could delete almost a million records every day. How can this be achieved?

Options:

A.

Schedule an @future process to query records older than seven years, and then recursively invoke itself in 1,000 record batches to delete them.

B.

Use aggregate functions to query for records older than seven years, and then delete the AggregateResult objects.

C.

Perform a SOSL statement to find records older than 7 years, and then delete the entire result set.

D.

Schedule a batch Apex process to run every day that queries and deletes records older than seven years.

Buy Now
Questions 7

A developer is writing a Jest test for a Lightning web component that conditionally displays child components based on a user’s checkbox selections. What should the developer do to properly test that the correct components display and hide for each scenario?

Options:

A.

Add a teardown block to reset the DOM after each test.9

B.

Create a new describe block for each test.10

C.

Create a new j.sdom instance for each test.11

D.

Reset the DOM after each test with the afterEach() method.12

Buy Now
Questions 8

A company wants to track revenue through a related object. They need to perform a one-time seeding of data for roughly 100,000 Opportunities, creating Revenue records based on complex logic. What is the optimal way to automate this?

Options:

A.

Use Database.executeBatch() to invoke a Database.Batchable class.

B.

Use System.enqueueJob() to invoke a Queueable class.

C.

Use Database.executeBatch() to invoke a Queueable class.

D.

Use System.scheduleJob() to schedule a Database.Scheduleable class.

Buy Now
Questions 9

The test method calls an @future method that increments a value. The assertion is failing because the value equals 0. What is the optimal way to fix this?

Java

@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];

System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c);

}

Options:

A.

Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).

B.

Add Test.startTest() before and Test.stopTest() after insert acct.

C.

Change the initialization to acct.Number_Of_Times_Viewed__c = 1.

D.

Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.

Buy Now
Questions 10

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 Event16

Buy Now
Questions 11

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

Java

public class without sharing OrderQueueableJob implements Queueable {

public void execute(QueueableContext context) {

// implementation logic

System.enqueueJob(new FollowUpJob());

}

}

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

Options:

A.

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

B.

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

C.

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

D.

Enclose System.enqueueJob(new OrderQueueableJob()) within Test.startTest and Test.stopTest().

Buy Now
Questions 12

A developer is trying to decide between creating a Visualforce component or a Lightning component. Which scenario necessitates the use of Visualforce?

Options:

A.

Does the screen need to be rendered as a PDF without using a third-party application?

B.

(Option Not Provided in Context)

C.

Will the screen make use of a JavaScript framework?

D.

(Matches Option A in context of question logic)

Buy Now
Questions 13

Consider the following code snippet:

HTML

<template for:each={orders.data} for:item="order">

</template>

How should the component communicate to the component that an order has been selected by the user?

Options:

A.

Create and dispatch a custom event.

B.

Create and fire a component event.

C.

Create and fire an application event.

D.

Create and fire a standard DOM event.

Buy Now
Questions 14

Refer to the code snippet below:

Java

public static void updateCreditMemo(String customerId, Decimal newAmount){

List toUpdate = new List();

for(Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50]) {

creditMemo.Amount__c = newAmount;

toUpdate.add(creditMemo);

}

Database.update(toUpdate,false);

}

A custom object called Credit_Memo__c exists in a Salesforce environment. As part of a new feature development, the developer needs to ensure race conditions are prevented when a set of records are mod1ified within an Apex transaction. In the preceding Apex code, how can the developer alter the que2ry statement to use SOQL features to prevent race conditions within a tr3ansaction?4

Options:

A.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR UPDATE]

B.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId USING SCOPE LIMIT 50]

C.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR REFERENCE]

D.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR VIEW]

Buy Now
Questions 15

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?

Options:

A.

Static resources

B.

Custom metadata

C.

Custom settings

D.

System.Cookie class

Buy Now
Questions 16

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?

Options:

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.

Buy Now
Questions 17

Refer to the component code and requirements below:

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}

Requirements:

    For mobile devices, the information should display in three rows.

    For desktops and tablets, the information should display in a single row.

Requirement 2 is not displaying as desired. Which option has the correct component code to meet the requirements for desktops an7d tablets?

Options:

A.

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}

B.

1213

C.

1415

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}

D.

HTML

{!v.account.Name}

{!v.account.AccountNumber}

{!v.account.Industry}

Buy Now
Questions 18

A developer is asked to develop a new AppExchange application. A feature creates Survey records when a Case reaches a certain stage. This needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the app needs to come with a set of best practice settings. What should the developer use to store and package the custom configuration settings for the app?

Options:

A.

Custom settings

B.

Custom objects

C.

Custom metadata

D.

Custom labels

Buy Now
Questions 19

A Salesforce developer is hired by a multi-national company to build a custom Lightning application that shows employees their employment benefits and earned commissions over time. The application must acknowledge and respect the user's locale context for dates, times, numbers, currency, and currency symbols. When using Aura components, which approach should the developer implement to ensure the Lightning application complies with the user's locale?3

Options:

A.

Use the $User global variable to retrieve the user preferences.4

B.

Create a Hierarchical custom setting to store user preferences.5

C.

Use the $Locale value provider to retrieve the user preferences.67

D.

Use the $Label global value provider.89

Buy Now
Questions 20

Refer to the code below:

Lightning Web Component JS file

JavaScript

import {LightningElement} from 'lwc';

import serverEcho from '@salesforce/apex/SimpleServerSideController.serverEcho';

export default class Helloworld extends LightningElement {

firstName = 'world';

handleClick() {

serverEcho({

firstName: this.firstName

})

.then((result) => {

alert('From server: ' + result);

})

.catch((error) => {

console.error(error);

});

}

}

Apex Controller

Java

public with sharing class SimpleServerSideController {

@AuraEnabled

public static String serverEcho(sObject firstName) {

String firstNameStr = (String)firstName.get('firstName');

return ('Hello from the server, ' + firstNameStr);

}

}

Given the code above, which two changes need to be made in the Apex Controller for the code to work?

Options:

A.

Annotate the entire class as @AuraEnabled instead of just the single method.

B.

Change the argument in the Apex Controller line 05 from sObject to String.

C.

Remove line 06 from the Apex Controller and instead use firstName in the return on line 07.

D.

Change the method signature to be global static, not public static.

Buy Now
Questions 21

Consider the following code snippet:

HTML

<apex:page docType="html-5.0" controller="FindOpportunities">

<apex:form >

<apex:pageBlock >

<apex:pageBlockSection title="find opportunity">

<apex:input label="opportunity name"/>

<apex:commandButton value="search" action="{!search}"/>

</apex:pageBlockSection>

<apex:pageBlockSection title="Opportunity List" id="opportunityList">

</apex:pageBlockSection>

</apex:pageBlock>

</apex:form>

</apex:page>

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 t13he section identified with opportunityList is re-drawn on the screen?1415

Options:

A.

Enclose the DAT16A table within the <apex:actionRegion> tag.1718

B.

Implement the <apex:actionFunction> tag with immediate = true.

C.

Ensure the action method search returns null.19

D.

Implement the reRender attribute on the <apex:commandButton> tag.

Buy Now
Questions 22

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

Buy Now
Questions 23

Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

Options:

A.

Use setSavePoint() and rollback() with a try-catch block.

B.

Use a Database Savepoint method with a try-catch block.

C.

Use the Database.Insert method with allOrNone set to false.

D.

Use the Database.Delete method if the Contact insertion fails.

Buy Now
Questions 24

Which code snippet processes records in the most memory efficient manner, avoiding governor limits such as "Apex heap size too large"?

Options:

A.

Java

Map opportunities = new Map([SELECT Id, Amount from Opportunity]);

for(Id oppId: opportunities.keySet()){

// perform operation here

}

B.

Java

for(Opportunity opp: [SELECT Id, Amount from Opportunity]){

// perform operation here

}

C.

Java

List opportunities = Database.query('SELECT Id, Amount from Opportunity');

for(Opportunity opp: opportunities){

// perform operation here

}

D.

Java

List opportunities = [SELECT Id, Amount from Opportunity];

for(Opportunity opp: opportunities){

// perform operation here

}

Buy Now
Questions 25

An org records customer order information in a custom object, Order__c, that has fields for the shipping address. A developer is tasked with adding code to calculate shipping charges on an order, based on a flat percentage rate associated with the region of the shipping address. What should the developer use to store the rates by region, so that when the changes are deployed to production no additional steps are needed for the calculation to work?3132

Options:

A.

Custom metadata type3334

B.

Custom list setting3536

C.

Custom object3738

D.

Custom hierarchy setting3940

Buy Now
Questions 26

A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users encounter "View State" errors when using it in production. What should the developer ensure to correct these errors?

Options:

A.

Ensure profiles have access to the Visualforce page.

B.

Ensure properties are marked as private.

C.

Ensure variables are marked as transient.12

D.

Ensure queries do not exceed governor limits.34

Buy Now
Questions 27

A developer needs a Lightning web component to display in one column on phones and two columns on tablets/desktops. Which should the developer add to the code?

Options:

A.

Add size="12" medium-device-size="6" to the elements

B.

Add size="6" small-device-size="12" to the elements

C.

Add small-device-size="12" to the elements

D.

Add medium-device-size="6" to the elements

Buy Now
Questions 28

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?

Options:

A.

An Apex trigger that calls an @future method that allows callouts910

B.

A flow that calls an @future method that allows callouts1112

C.

A flow with an outbound message that contains a session ID1314

D.

A platform event that makes a callout to the web application1516

Buy Now
Questions 29

When developing a Lightning web component, which setting displays lightning-layout items in 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="6" small-device-size="12"

C.

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

D.

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

Buy Now
Questions 30

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 metadata

B.

Custom object

C.

Custom setting

D.

Custom variable

Buy Now
Questions 31

Universal Containers wants to develop a recruiting app for iOS and Android via the standard Salesforce mobile app. It has a custom user interface design and offline access is not required. What is the recommended approach to develop the app?

Options:

A.

Salesforce SDK

B.

Lightning Web Components

C.

Lightning Experience Builder

D.

Visualforce

Buy Now
Questions 32

Which statement is considered a best practice for writing bulk safe Apex triggers?

Options:

A.

Add LIMIT 50000 to every SOQL statement.

B.

Add records to collections and perform DML operations against these collections.

C.

Use the Database methods with allOrNone set to false instead of DML statements.

D.

Perform all DML operations from within a future method.

Buy Now
Questions 33

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.

Buy Now
Questions 34

As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors using toast messages. During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components. Which two techniques should the developer implement to improve the user experience?

Options:

A.

Use a Lightning web component to aggregate and display all errors.

B.

Use the window.alert() method to display the error messages.23

C.

Use a <template> tag to display in-place error messages.24

D.

Use public properties on each component to display the error messages.25

Buy Now
Questions 35

A developer is writing code that requires making callouts to an external web service. Which scenario necessitates that the callout be made in an asynchronous method?

Options:

A.

The callout could take longer than 60 seconds to complete.

B.

The callouts will be made in an Apex trigger.

C.

Over 10 callouts will be made in a single transaction.

D.

The callouts will be made using the REST API.

Buy Now
Questions 36

A developer implemented a custom data table in a Lightning web component with filter functionality. However, users are submitting support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records based on the selected filters. What should the developer do to improve performance of the component?

Options:

A.

Use SOSL to query the records on filter change.1

B.

Use setStorable() in the Apex method to store the response in the client-side cache.2

C.

Return all records into a list when the component is created and filter the array in JavaScript.3

D.

Use a4 selective SOQL query with a custom index.

Buy Now
Questions 37

Consider the following code snippet:

Java

HttpRequest req = new HttpRequest();

req.setEndpoint('https://TestEndpoint.example.com/some_path ');

req.setMethod('GET');

Blob headerValue = Blob.valueOf('myUserName' + ':' + 'strongPassword');

String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

req.setHeader('Authorization', authorizationHeader);

Http http = new Http();

HTTPResponse res = http.send(req);

Which two steps should the developer take to add flexibility to change the endpoint and credentials without needing to modify code?1

Options:

A.

Use req.setEndpoint(Label.endPointURL);

B.

Use req.setEndpoint('callout:endPoint_NC'); within the callout request.2

C.

Store the URL of the3 endpoint in a custom Label named endPointURL.4

D.

Create a Named Credential, endPoint_NC, to store the endpoint and credentials.5

Buy Now
Questions 38

A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record. Which best practice should the developer use to perform the validations on more than one field, thus allowing more than one error message to be displayed simultaneously?

Options:

A.

Apex REST

B.

Client-side validation

C.

Next Best Action

D.

Custom validation rules

Buy Now
Questions 39

An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. A developer is tasked with preventing Contract records from being created when mass loading historical Opportunities, but the daily users still need the logic to fire. 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 hierarchy custom setting to skip executing the logic inside the trigger for the user who loads the data.

D.

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

Buy Now
Questions 40

An Apex trigger creates an Order__c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders. What is the optimal technique for a developer to troubleshoot this?

Options:

A.

Disable all flows, and then re-enable them one at a time to see which one causes the error.

B.

Set up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.

C.

Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.

D.

Add system.debug() statements to the code and use the Developer Console logs to trace the code.

Buy Now
Questions 41

A Salesforce org has more than 50,000 contacts. A new business process requires a calculation that aggregates data from all of these contact records. This calculation needs to run once a day after business hours. Which two steps should a developer take to accomplish this?

Options:

A.

Use the @future annotation.

B.

Implement the Database.Batchable interface.

C.

Implement the Schedulable interface.

D.

Implement the Queueable interface.

Buy Now
Questions 42

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

Options:

A.

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

B.

Create all test data in the test class, use System.runAs() to invoke the trigger, then perform assertions.

C.

Create all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform assertions.

D.

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

Buy Now
Questions 43

Refer to the test method below:

Java

@isTest

static void testAccountUpdate() {

Account acct = new Account(Name = 'Test');

acct.Integration_Updated__c = false;

insert acct;

CalloutUtil.sendAccountUpdate(acct.Id);

Account acctAfter = [SELECT Id, Integration_Updated__c FROM Account WHERE Id = :acct.Id][0];

System.assert(true, acctAfter.Integration_Updated__c);

}

The test method calls a web service that updates an external system with Account information and sets the Account's 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." What is the optimal way to fix this?

Options:

A.

Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.

B.

Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

C.

Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.

D.

Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

Buy Now
Questions 44

A developer creates a lightning web component to allow a Contact to be quickly entered. However, error messages are not displayed.

HTML

<template>

</template>

Which component should the developer add to the form to display error messages?12

Options:

A.

lightning-messages

B.

lightning-error

C.

apex:messages

D.

aura:messages

Buy Now
Questions 45

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

Options:

A.

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

B.

Use Developer Console to view the debug log.34

C.

Use console.log() messages in the JavaScript.56

D.

Use Developer Console to view7 checkpoints.8

E.

Enable Debug Mode for Lightning components for the user.9

Buy Now
Questions 46

A company has a Lightning page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data. What can a developer use to analyze and diagnose the problem in the Lightning page?

Options:

A.

Salesforce Lightning Inspector Storage tab12

B.

Salesforce Lightning Inspector Event Log tab34

C.

Salesforce Lightning Inspector Actions tab56

D.

Salesforce Lightning Inspector Transactions tab78

Buy Now
Questions 47

A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called Survey_Response__c do not belong to a list of blocked domains. The list of blocked domains is stored in a custom object for ease of maintenance by users. The Survey_Response__c object is populated via a custom Visualforce page. What is the optimal way to implement this?

Options:

A.

Implement the logic in validation rules on the Contact and the Survey_Response__c objects.

B.

Implement the logic in a helper class that is called by an Apex trigger on Contact and from the custom Visualforce page controller.

C.

Implement the logic in an Apex trigger on Contact and also implement the logic within the custom Visualforce page controller.

Buy Now
Questions 48

Which select statement should be inserted to retrieve Tasks ranging from 12 to 24 months old, including archived tasks, and excluding deleted ones?

Java

Date initialDate = System.Today().addMonths(-24);

Date endDate = System.Today().addMonths(-12);

Options:

A.

[SELECT ... FROM Task WHERE What.Type = 'Account' AND isArchived=true AND CreatedDate => :initialDate ...]

B.

[SELECT ... FROM Task WHERE What.Type = 'Account' AND CreatedDate => :initialDate ... ALL ROWS]

C.

[SELECT ... FROM Task WHERE What.Type = 'Account' AND isDeleted=false AND CreatedDate => :initialDate ... ALL ROWS]

D.

[SELECT ... FROM Task WHERE What.Type = 'Account' AND isArchived=true AND CreatedDate => :initialDate ... ALL ROWS]

Buy Now
Exam Code: PDII
Exam Name: Salesforce Certified Platform Developer II ( Plat-Dev-301 )
Last Update: Jul 27, 2026
Questions: 161

PDF + Testing Engine

$59.99 $171.4

Testing Engine

$44.99 $128.55

PDF (Q&A)

$49.99 $142.82