Winter Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = pass65

Pass the Salesforce Developers PDII Questions and answers with Dumpstech

Exam PDII Premium Access

View all detail and faqs for the PDII exam

Practice at least 50% of the questions to maximize your chances of passing.
Viewing page 1 out of 5 pages
Viewing questions 1-10 out of questions
Questions # 1:

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.

Questions # 2:

A developer has a Visualforce page that automatically assigns ownership 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 implement the Queueable interface.

B.

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

C.

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

D.

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

Questions # 3:

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.

Questions # 4:

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 insert1

Questions # 5:

A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:

HTML

<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes">

Hello!

</aura:component>

How can the component's controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?

Options:

A.

Create a design attribute and configure via App Builder.

B.

Set the sObject type as a component attribute.

C.

Use the getSObjectType() method in an Apex class.

D.

Add force:hasSObjectName to the implements attribute.

Questions # 6:

A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created. Which consideration should be checked to resolve the issue?

Options:

A.

Ensure test classes are using SeeAllData = true.15

B.

Ensure the Apex classes are on the same API version.16

C.

Ensure the sandbox is on the same release as production.17

D.

Ensure that Disable Parallel Apex Testing is unchecked.18

Questions # 7:

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.

Questions # 8:

A developer has a test class that creates test data before making a mock callout but now receives a "You have uncommitted work pending. Please commit or rollback before calling out" error. Which step should be taken to resolve the error?

Options:

A.

Ensure both the insertion and mock callout occur after the Test.stopTest().1

B.

Ensure the records are inserted before the Test.startTest() statement and the mock callout occurs within a method annotated with @testSetup.2

C.

Ensure the records are inserted befo3re the Test.startTest() statement and the mock callout occurs after the Test.startTest().45

D.

Ensure both the insertion and mock callout occur after the Test.startTest().67

Questions # 9:

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

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

Viewing page 1 out of 5 pages
Viewing questions 1-10 out of questions