Spring Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple70

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 4 out of 5 pages
Viewing questions 31-40 out of questions
Questions # 31:

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.

Questions # 32:

A developer is tasked with creating a Lightning web component that allows users to create a Case for a selected product, directly from a custom Lightning page. The input fields in the component are displayed in a non-linear fashion on top of an image of the product to help the user better understand the meaning of the fields. Which two components should a developer use to implement the creation of the Case from the Lightning web component?161718

Options:

A.

lightning-record-form192021

B.

lightning-record-edit-form222324

C.

lightnin25g-input-field2627

D.

lightning-input2829

Questions # 33:

Refer to the Aura component below:

HTML

<aura:component>

<aura:attribute name="contactInfo" type="Object"/>

<aura:attribute name="showContactInfo" type="boolean" default="true"/>

<aura:handler name="init" value="{!this}" action="{!c.init}"/>

<aura:if isTrue="{!v.showContactInfo}">

</aura:if>

</aura:component>

A developer receives complaints that the component loads slowly. Which change can the developer implement to make the component perform faster?

Options:

A.

Move the contents of into the component.

B.

Change the type of contactInfo to "Map".

C.

Change the default for showContactInfo to "false".

Questions # 34:

A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes. Recently, users notice that fields that were recently added for one department suddenly disappear without warning. Which two statements are true regarding these issues and resolution?3637

Options:

A.

The administrators are deploying their own Change Sets, thus deleting each other's fields from the objects in production.3839

B.

The admin40istrators are deploying their own Change Sets over each othe41r, thus replacing entire Page Layouts in production.

C.

Page Layouts should never be deployed via Change Sets, as this causes Field-Level Security to be reset and fields to disappear.42

D.

A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to produ43ction.

Questions # 35:

What are three reasons that a developer should write Jest tests for Lightning web components?

Options:

A.

To test basic user interaction

B.

To test a component’s non-public properties

C.

To test how multiple components work together

D.

To verify the DOM output of a component

E.

To verify that events fire when expected

Questions # 36:

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

Options:

A.

SELECT Id FROM Account WHERE Id IN (List of Account Ids)

B.

SELECT Id FROM Account WHERE Name IN (List of Names) AND Customer_Number__c = 'ValueA'

C.

SELECT Id FROM Account WHERE Name != ''

D.

SELECT Id FROM Account WHERE Name LIKE '%Partner'

Questions # 37:

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

}

Questions # 38:

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)

Questions # 39:

An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved. What is the optimal way to implement this?

Options:

A.

Apex triggers on Contact and Account that normalize the address

B.

Apex trigger on Account that calls the Contact trigger to normalize the address

C.

Apex trigger on Contact that calls the Account trigger to normalize the address

D.

Apex triggers on Contact and Account that call a helper class to normalize the address

Questions # 40:

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.

Viewing page 4 out of 5 pages
Viewing questions 31-40 out of questions