
Salesforce Platform Developer I (PDI) - PDI Exam Questions
QUESTION NO: 1
What will be the output in the debug log in the event of a QueryException during a call to the aQuery method if it is following example?
public class myclass { class CustomException extends Exception {}
public static Account aQuery() {
Account theAccount;
try {
system.debug( ' Querying Accounts. ' );
theAccount = [SELECT Id FROM Account WHERE CreatedDate > TODAY];
}
catch (CustomException ex) {
system.debug( ' Custom Exception. ' );
}
catch (QueryException ex) {
system.debug( ' Query Exception. ' );
}
finally {
system.debug( ' Done. ' );
}
return theAccount;
}
What will be the output in the debug log in the event of a QueryException during a call to the aQuery method if it is following example?
public class myclass { class CustomException extends Exception {}
public static Account aQuery() {
Account theAccount;
try {
system.debug( ' Querying Accounts. ' );
theAccount = [SELECT Id FROM Account WHERE CreatedDate > TODAY];
}
catch (CustomException ex) {
system.debug( ' Custom Exception. ' );
}
catch (QueryException ex) {
system.debug( ' Query Exception. ' );
}
finally {
system.debug( ' Done. ' );
}
return theAccount;
}
Correct Answer: D
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 2
Which three code lines are required to create a Lightning component on a Visualforce page?
Choose 3 answers
Which three code lines are required to create a Lightning component on a Visualforce page?
Choose 3 answers
Correct Answer: C,D,E
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 3
What is the result of the following code?
Account a = new Account();
Database.insert(a, false);
What is the result of the following code?
Account a = new Account();
Database.insert(a, false);
Correct Answer: C
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 4
Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?
Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?
Correct Answer: D
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 5
Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
Correct Answer: A
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 6
What are two use cases for executing Anonymous Apex code?
What are two use cases for executing Anonymous Apex code?
Correct Answer: A,C
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 7
A developer creates a batch Apex job to update a large number of records and receives reports of the job timing out and not completing.
What is the first step towards troubleshooting the issue?
A developer creates a batch Apex job to update a large number of records and receives reports of the job timing out and not completing.
What is the first step towards troubleshooting the issue?
Correct Answer: B
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 8
A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of Apex tests allowing them to test isolated requirements for various types of Salesforce cases.
Which approach can efficiently generate the required data for each unit test?
A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of Apex tests allowing them to test isolated requirements for various types of Salesforce cases.
Which approach can efficiently generate the required data for each unit test?
Correct Answer: A
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 9
An org has an existing flow that edits an Opportunity with an Update Records element.
A developer must update the flow to also create a Contact and store the created Contact ' s ID on the Opportunity.
Which update must the developer make in the flow?
An org has an existing flow that edits an Opportunity with an Update Records element.
A developer must update the flow to also create a Contact and store the created Contact ' s ID on the Opportunity.
Which update must the developer make in the flow?
Correct Answer: D
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 10
Universal Containers (UC) processes orders in Salesforce in a custom object, order_c.
They also allow sales reps to upload CSV files with thousands of orders at a time.
A developer is tasked with integrating orders placed in Salesforce with UC ' s enterprise resource planning (ERP) system.
After the status for an order_c is first set to ' Placed ' , the order information must be sent to a REST endpoint in the ERP system that can process one order at a time.
What should the developer implement to accomplish this?
Universal Containers (UC) processes orders in Salesforce in a custom object, order_c.
They also allow sales reps to upload CSV files with thousands of orders at a time.
A developer is tasked with integrating orders placed in Salesforce with UC ' s enterprise resource planning (ERP) system.
After the status for an order_c is first set to ' Placed ' , the order information must be sent to a REST endpoint in the ERP system that can process one order at a time.
What should the developer implement to accomplish this?
Correct Answer: C
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 11
Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a master-detail relationship with the standard Account object.
Based on some internal discussions, the UC administrator tried to change the master detail relationship to a lookup relationship, but was not able to do so.
What is a possible reason that this change was not permitted?
Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a master-detail relationship with the standard Account object.
Based on some internal discussions, the UC administrator tried to change the master detail relationship to a lookup relationship, but was not able to do so.
What is a possible reason that this change was not permitted?
Correct Answer: C
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 12
How can a developer check the test coverage of autolaunched Flows before deploying them in a change set?
How can a developer check the test coverage of autolaunched Flows before deploying them in a change set?
Correct Answer: D
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 13
A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank.
Which automation allows the developer to satisfy this requirement in the most efficient manner?
A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank.
Which automation allows the developer to satisfy this requirement in the most efficient manner?
Correct Answer: D
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 14
A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purpose.
The following code is executed in the Developer Console using the Execute Anonymous window:
Account myAccount = new Account (Name = ' MyAccount ' );
insert myAccount;
Integer x = 1;
List < Account > newAccounts = new List < Account > ();
do{
Account acct = new Account (Name = ' New Account ' + x++);
newAccounts.add(acct);
} while (x < 10);
How many total accounts will be in the org after this code is executed?
A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purpose.
The following code is executed in the Developer Console using the Execute Anonymous window:
Account myAccount = new Account (Name = ' MyAccount ' );
insert myAccount;
Integer x = 1;
List < Account > newAccounts = new List < Account > ();
do{
Account acct = new Account (Name = ' New Account ' + x++);
newAccounts.add(acct);
} while (x < 10);
How many total accounts will be in the org after this code is executed?
Correct Answer: B
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 15
Which two actions may cause triggers to fire?
Which two actions may cause triggers to fire?
Correct Answer: C,D
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).




