New Year Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: Board70

PDII Exam Dumps - Salesforce Developers Questions and Answers

Question # 4

Refer to the following code snippet:

Java

public class LeadController {

public static List getFetchLeadList(String searchTerm, Decimal aRevenue) {

String safeTerm = '%'+searchTerm.escapeSingleQuotes()+ '%';

return [

SELECT Name, Company, AnnualRevenue

FROM Lead

WHERE AnnualRevenue >= :aRevenue

AND Company LIKE :safeTerm

LIMIT 20

];

}

}

A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling getFetchLeadList when certain criteria are met. Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?1

Options:

A.

Use the WITH SECURITY_ENFORCED clause within the SOQL query.

B.

Implement the with sharing keyword in the class declaration.567

C.

Annotate 8the Apex method with @AuraEnabled(Cacheable=true).

D.

Implement the without sharing keyword in the class declaration.

E.

Annotate the Apex method with @AuraEnabled.

Buy Now
Question # 5

Universal Containers implements a private sharing model for Convention_Attendee__c. A lookup field Event_Reviewer__c was created. Management wants the event reviewer to automatically gain Read/Write access to every record they are assigned to. What is the best approach?

Options:

A.

Create an after insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.

B.

Create a before insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.

C.

Create criteria-based sharing rules on the Convention Attendee custom object to share the records with the Event Reviewers.

D.

Create a criteria-based sharing rule on the Convention Attendee custom object to share the records with a group of Event Reviewers.

Buy Now
Question # 6

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
Question # 7

A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page. Which Apex code feature is required to facilitate this solution?

Options:

A.

Dynamic SOQL

B.

Metadata API

C.

Streaming API

D.

Variable binding

Buy Now
Question # 8

The Salesforce admin at Cloud Kicks created a custom object called Region__c to store all postal zip codes in the United States and the Cloud Kicks sales region the zip code belongs to.

Object Name: Region__c

Fields: Zip_Code__c (Text), Region_Name__c (Text)

Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code. Which code segment is the most efficient way to fulfill this request?1234

Options:

A.

5678

Java

Set zips = new Set();

for(Lead l : Trigger.new) {

if(l.PostalCode != Null) {

zips.add(l.PostalCode);

}

}

for(Lead l : Trigger.new) {

List regions = [SELECT Zip_Code__c, Region_Name__c FROM Region__c WHERE Zip_Code__c IN :zips];

for(Region__c r : regions) {

if(l.PostalCode == r.Zip_Code__c) {

B.

Region__c = r.Region_Name__c;

}

}

}

C.

Java

Set zips = new Set();

for(Lead l : Trigger.new) {

if(l.PostalCode != Null) {

zips.add(l.PostalCode);

}

}

List regions = [SELECT Zip_Code__c, Region_Name__c FROM Region__c WHERE Zip_Code__c IN :zips];

for(Lead l : Trigger.new) {

for(Region__c r : regions) {

if(l.PostalCode == r.Zip_Code__c) {

D.

Region__c = r.Region_Name__c;

}

}

}

E.

Java

for(Lead l : Trigger.new) {

Region__c reg = [SELECT Region_Name__c FROM Region__c WHERE Zip_Code__c = :l.PostalCode];

F.

Region__c = reg.Region_Name__c;

}

G.

Java

Set zips = new Set();

for(Lead l : Trigger.new) {

if(l.PostalCode != Null) {

zips.add(l.PostalCode);

}

}

List regions = [SELECT Zip_Code__c, Region_Name__c FROM Region__c WHERE Zip_Code__c IN :zips];

Map zipMap = new Map();

for(Region__c r : regions) {

zipMap.put(r.Zip_Code__c, r.Region_Name__c);

Buy Now
Question # 9

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
Question # 10

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
Question # 11

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

Options:

A.

Java

List contactList = new List ();

Set accountIds = new Set ();

for(Opportunity o : opportunityList){

accountIds.add(o.AccountId);

}

for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){

contactList.addAll(a.Contacts);

}

B.

20

Java

List contactList = new List ();

for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId ]){

contactList.add(c);

}

Buy Now
Question # 12

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
Question # 13

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
Exam Code: PDII
Exam Name: Salesforce Certified Platform Developer II ( Plat-Dev-301 )
Last Update: Jan 4, 2026
Questions: 161
PDII pdf

PDII PDF

$25.5  $84.99
PDII Engine

PDII Testing Engine

$28.5  $94.99
PDII PDF + Engine

PDII PDF + Testing Engine

$40.5  $134.99