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

PDII Exam Dumps - Salesforce Developers Questions and Answers

Question # 44

A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the developer do to speed up test execution?

Options:

A.

Define a method that creates test data and annotate with @createData.

B.

Reduce the amount of test methods in the class.12

C.

Define a method that creates test data and annotate with @testSetup.

D.

Ensure proper usage of test data factory in all test methods.34

Buy Now
Question # 45

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 using the REST API.

C.

The callouts will be made in an Apex trigger.

D.

Over 10 callouts will be made in a single transaction.

Buy Now
Question # 46

A developer wants to write a generic Apex method that will compare the Salesforce Name field between any two object records. For example, to compare the Name field of an Account and an Opportunity; or the Name of an Account and a Contact. Assuming the Name field exists, how should the developer do this?4

Options:

A.

Use a String.replace() method to parse the contents of each Name field and then compare the results.567

B.

Use the Salesforce Metadata API to extrac8t the value of each object and compare the Name fields.910

C.

Cast each object into an sObject and use sObject.get('Name') to compare the Name fields.1112

D.

Invo13ke a Schema.describe() function to compare the14 values of each Name field.

Buy Now
Question # 47

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

Universal Containers is leading a development team that follows the source-driven development approach in Salesforce. As part of their continuous integration and delivery (CI/CD) process, they need to automatically deploy changes to multiple environments, including sandbox and production. Which mechanism or tool would best support their CI/CD pipeline in source-driven development?

Options:

A.

Salesforce CLI with Salesforce DX

B.

Change Sets

C.

Salesforce Extensions for Visual Studio Code

D.

Ant Migration Tool

Buy Now
Question # 49

A company wants to allow support managers to see all cases in the org, regardless of who owns them. However, they want to support agents to only see cases they own or cases owned by someone in their role or a subordinate role. Which sharing solution should a developer use to achieve this requirement?

Options:

A.

Sharing sets

B.

Apex managed sharing

C.

Role hierarchy

D.

Criteria-based sharing rules

Buy Now
Question # 50

An Apex trigger and Apex class increment a counter, `Edit_Count__c`, any time the Case is changed.

```java

public class CaseTriggerHandler {

public static void handle(List cases) {

for (Case c : cases) {

c.Edit_Count__c = c.Edit_Count__c + 1;

}

}

}

trigger on Case(before update) {

CaseTriggerHandler.handle(Trigger.new);

}

```

A new before-save record-triggered flow on the Case object was just created in production for when a Case is created or updated. Since the process was added, there are reports that `Edit_Count__c` is being incremented more than once for Case edits. Which Apex code fixes this problem?

Options:

A.

```java

public class CaseTriggerHandler {

public static Boolean firstRun = true;

public static void handle(List cases) {

for (Case c : cases) {

B.

Edit_Count__c = c.Edit_Count__c + 1;

}

}

}

trigger on Case(before update) {

CaseTriggerHandler.firstRun = true;

if (CaseTriggerHandler.firstRun) {

CaseTriggerHandler.handle(Trigger.newMap);

}

CaseTriggerHandler.firstRun = false;

}

```

C.

```java

public class CaseTriggerHandler {

public static Boolean firstRun = true;

public static void handle(List cases) {

for (Case c : cases) {

D.

Edit_Count__c = c.Edit_Count__c + 1;

}

}

}

trigger on Case(before update) {

if (CaseTriggerHandler.firstRun) {

CaseTriggerHandler.handle(Trigger.new);

}

CaseTriggerHandler.firstRun = false;

}

```

E.

```java

public class CaseTriggerHandler {

Boolean firstRun = true;

public static void handle(List cases) {

if (firstRun) {

for (Case c : cases) {

F.

Edit_Count__c = c.Edit_Count__c + 1;

}

}

firstRun = false;

}

}

trigger on Case(before update) {

CaseTriggerHandler.handle(Trigger.new);

}

```

G.

```java

trigger on Case(before update) {

Boolean firstRun = true;

if (firstRun) {

CaseTriggerHandler.handle(Trigger.newMap);

}

firstRun = false;

}

```

Buy Now
Question # 51

A developer wrote an Apex class to make several callouts to an external system. If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class?

Options:

A.

Named Credentials

B.

Connected Apps

C.

Remote Site Settings

D.

Session Id

Buy Now
Exam Code: PDII
Exam Name: Salesforce Certified Platform Developer II ( Plat-Dev-301 )
Last Update: Feb 20, 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