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 3 out of 5 pages
Viewing questions 21-30 out of questions
Questions # 21:

Java

@isTest

static void testUpdateSuccess() {

Account acet = new Account(Name = 'test');

insert acet;

// Add code here

extension.inputValue = 'test';

PageReference pageRef = extension.update();

System.assertNotEquals(null, pageRef);

}

What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?

Options:

A.

AccountControllerExt extension = new AccountControllerExt(acet);

B.

ApexPages.StandardController sc = new ApexPages.StandardController(acet); AccountControllerExt extension = new AccountControllerExt(sc);

C.

ApexPages.StandardController sc = new ApexPages.StandardController(acet.Id); AccountControllerExt extension = new AccountControllerExt(sc);

D.

AccountControllerExt extension = new AccountControllerExt(acet.Id);

Questions # 22:

A company manages information about their product offerings in custom objects named Catalog and Catalog Item. Catalog Item has a master-detail field to Catalog, and each Catalog may have as many as 100,000 Catalog Items. Both custom objects have a CurrencyIsoCode text field that contains the currency code they should use. If a Catalog's CurrencyIsoCode changes, all of its Catalog Items' CurrencyIsoCodes should be changed as well. What should a developer use to update the CurrencyIsoCodes on the Catalog Items when the Catalog's CurrencyIsoCode changes?

Options:

A.

An after update trigger on Catalog that updates the Catalog Items if the Catalog's CurrencyIsoCode is different.

B.

An after insert trigger on Catalog Item that updates the Catalog Items if the Catalog's CurrencyIsoCode is different.

C.

A Database.Schedulable and Database.Batchable class that queries the Catalog object and updates the Catalog Items if the Catalog CurrencyIsoCode is different.

D.

A Database.Schedulable and Database.Batchable class that queries the Catalog Item object and updates the Catalog Items if the Catalog CurrencyIsoCode is different.

Questions # 23:

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);

}

Questions # 24:

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.

Questions # 25:

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"

Questions # 26:

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

Questions # 27:

An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters. What is the optimal way to implement these requirements?12345

Options:

A.

Write a Validation Rule on the Contact for the Is Primary logic and a before upd6ate trigger on Contact for the last name lo7gic.8910

B.

Write an after update trigger on Conta11ct for the Is Primary logic and a separate befo12re update trigger on Contact for th13e last name logic.

C.

Write an after update trigger on Account for the Is Primary logic and a before update trigger on Contact for the last name logic.

D.

Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.14

Questions # 28:

Universal Containers uses a custom Lightning page to provide a mechanism to perform a step-by-step wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERP_Number__c, that is then used in a query to find matching Accounts.

Java

erpNumber = erpNumber + '%';

List accounts = [SELECT Id, Name FROM Account WHERE ERP_Number__c LIKE :erpNumber];

A developer receives the exception 'SOQL query not selective enough'. Which step should be taken to resolve the issue?

Options:

A.

Move the SOQL query to within an asynchronous process.

B.

Mark the ERP_Number__c field as required.

C.

Mark the ERP_Number__c field as an external ID.

D.

Change the query to use a SOSL statement instead of SOQL.

Questions # 29:

Java

trigger AssignOwnerByRegion on Account ( before insert, before update ) {

List accountList = new List();

for( Account anAccount : trigger.new ) {

Region__c theRegion = [

SELECT Id, Name, Region_Manager__c

FROM Region__c

WHERE Name = :anAccount.Region_Name__c

];

anAccount.OwnerId = theRegion.Region_Manager__c;

accountList.add( anAccount );

}

update accountList;

}

Consider the above trigger. Which two changes should a developer make in this trigger to adhere to best practices?30

Options:

A.

Remove the last line updating accountList as it is not needed.31

B.

Use a Map accountMap instead of List accountList.32

C.

Use a Map to cache the results of the Region__c query by Id.33

D.

Move the Re34gion__c query to outside the loop.

Questions # 30:

A software company uses a custom object, Defect__c, to track defects in their software. Defect__c has organization-wide defaults set to private. Each Defect__c has a related list of Reviewer__c records, each with a lookup field to User that is used to indicate that the User will review the Defect__c. What should be used to give the User on the Reviewer__c record read only access to the Defect__c record on the Reviewer__c record?34

Options:

A.

View All on Defect__c

B.

Criteria-based sharing56

C.

Lightning web component78

D.

Apex managed sharing910

Viewing page 3 out of 5 pages
Viewing questions 21-30 out of questions