Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Salesforce Platform Developer II (PDII) Free Practice Test

Question 1
Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving an Account.
How can a developer fix this error?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 2
A developer created a Lightning web component that allows users to input a text value that is used to search for Accounts by calling an Apex method. The Apex method returns a list of AccountWrappers and is called imperatively from a JavaScript event handler.
Java
01: public class AccountSearcher {
02:
03: public static List<AccountWrapper> search(String term) {
04: List<AccountWrapper> wrappers = getMatchingAccountWrappers(term);
05: return wrappers;
06: }
07:
08:
09: public class AccountWrapper {
10: public Account account { get; set; }
11: public Decimal matchProbability { get; set; }
12: }
13: // ...other methods, including getMatchingAccountWrappers implementation...
14: }
Which two changes should the developer make so the Apex method functions correctly?

Correct Answer: A,B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
A developer creates an application event that has triggered an infinite loop. What may have caused this problem?

Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
Which method should be used to convert a Date to a String in the current user's locale?

Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 5
Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Products__c, on the Account object that allows sales reps to specify which of UC's products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, including the Products__c field. What should the developer do to ensure the value of Products__c is in the current user's language?40

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
Refer to the code snippet below:
Java
public static void updateCreditMemo(String customerId, Decimal newAmount){ List<Credit_Memo__c> toUpdate = new List<Credit_Memo__c>(); for(Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50]) { creditMemo.Amount__c = newAmount; toUpdate.add(creditMemo);
}
Database.update(toUpdate,false);
}
A custom object called Credit_Memo__c exists in a Salesforce environment. As part of a new feature development, the developer needs to ensure race conditions are prevented when a set of records are mod1ified within an Apex transaction. In the preceding Apex code, how can the developer alter the que2ry statement to use SOQL features to prevent race conditions within a tr3ansaction?4

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 7
Consider the Apex class below that defines a RemoteAction used on a Visualforce search page.
Java
global with sharing class MyRemoter {
public String accountName { get; set; }
public static Account account { get; set; }
public MyRemoter() {}
@RemoteAction
global static Account getAccount(String accountName) {
account = [SELECT Id, Name, NumberOfEmployees FROM Account WHERE Name = :accountName]; return account;
}
}
Which code snippet will assert that the remote action returned the correct Account?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 8
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?

Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).