Apex Process Automation Exam Prep
Apex Process Automation Exam Prep
Key Topics
This module prepares you for the logic and process automation section of the Platform Developer I exam. The
process automation and logic section, which makes up 38% of the overall exam. In this unit we will review
these topics.
This module includes a number of interactive, real-world, scenario-based questions that are a lot like the ones
you can encounter as a Salesforce developer. Looking at these scenarios helps prepare you to take the
process automation and logic section of the Platform Developer I exam. As you tackle the practice questions,
you get immediate feedback on your answers, along with detailed information on why your answers are correct
(or incorrect).
This module includes three units on process automation and logic. This unit focuses on the basic constructs
within Apex.
1
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 1
When the number of records in a recordset is unknown, which control statement should a developer use to
implement a set of code that executes for every record in the recordset, without performing a .size() or .length()
method call?
ANSWER FEEDBACK
2
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 2
What is the value of x after the code segment executes?
String x = 'A';
Integer i = 10;
if ( i < 15 ){
i = 15;
x = 'B';
} else
if ( i < 20 ){
x = 'C';
} else {
x = 'D';
ANSWER FEEDBACK
3
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 3
Which three are accurate statements about variable scope? (Select three answers.)
ANSWER FEEDBACK
A. A VARIABLE CAN BE DEFINED AT ANY POINT IN Correct. A variable is valid from the point
A BLOCK. where it is declared inside of the code.
E. A STATIC VARIABLE CAN RESTRICT THE Incorrect. The value of a static variable persists
SCOPE TO THE CURRENT BLOCK IF ITS VALUE IS within the context of a single transaction and is
NULL. reset across transaction boundaries.
4
Platform Developer I Certification Prep: Process Automation and Logic
Read the question or term on each card, then click the card to reveal the correct answer. Click the right-facing
arrow to move to the next card, and the left-facing arrow to return to the previous card.
Question/Term Answer/Definition
Which two users can edit a
An administrator and a user who is
record after it has been
assigned as the current approver
locked for approval?
5
Platform Developer I Certification Prep: Process Automation and Logic
Related Badges
Module
Next, let’s review the second part of the process automation and logic section of the Platform Developer I
exam.
6
Platform Developer I Certification Prep: Process Automation and Logic
Key Topics
This unit prepares you for these topics in the logic and process automation section of the Platform Developer I
exam.
• SOQL
• SOSL
• DML
• Exceptions and governor limits
and why; if there’s a longer explanation, click and then click anywhere in the window to close it. When
you reach the end, you can review the answers or retake the questions.
7
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 1
A developer in a Salesforce org with 100 accounts executes the following code using the Developer Console.
How many accounts are in the org after this code is run?
ANSWER FEEDBACK
8
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 2
Which two statements should a developer avoid using inside procedural loops? (Select two answers.)
ANSWER FEEDBACK
D. SYSTEM.DEBUG('AMOUNT OF CPU
Incorrect. System.debug is a great way to test the output
TIME (IN MS) USED SO FAR: ' +
especially in loops.
LIMITS.GETCPUTIME());
9
Platform Developer I Certification Prep: Process Automation and Logic
Read the question or term on each card, then click on the card to reveal the correct answer. Click the right-
facing arrow to move to the next card, and the left-facing arrow to return to the previous card.
Question/Term Answer/Definition
Which data structure is returned to a developer
A list of lists of sObjects
when performing a SOSL search?
Delete acc;
2,150
Database.emptyRecycleBin(acc);
system.debug(Limits.getDMLStatements()+',
'+Limits.getLimitDMLStatements());
10
Platform Developer I Certification Prep: Process Automation and Logic
Related Badges
Module
Module
Great work! You’re almost finished reviewing the process automation and logic section of the Platform
Developer I exam. On to the last unit, which covers Apex classes and triggers.
11
Platform Developer I Certification Prep: Process Automation and Logic
Key Topics
This unit prepares you for these topics in the logic and process automation section of the Platform Developer I
exam.
• Apex classes
• Apex triggers
• Save order of execution
12
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 1
What is an accurate constructor for a custom controller named MyController?
ANSWER FEEDBACK
A. PUBLIC MYCONTROLLER(LIST<SOBJECT>
Incorrect. This is the structure of a controller
OBJECTS){ ACCOUNTS =
extension, not a custom controller.
(LIST<ACCOUNT>)OBJECTS;}
D. PUBLIC MYCONTROLLER(LIST<SOBJECT>
Incorrect. A custom controller constructor does not
OBJECTS){ ACCOUNTS =
have a parameter.
(LIST<ACCOUNT>)OBJECTS; }
13
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 2
A developer uses a before insert trigger on the Lead object to fetch the Territory__c object, where the
Territory__c.PostalCode__c matches the Lead.PostalCode. The code fails when the developer uses the Apex
Data Loader to insert 10,000 lead records. The developer has the following code block.
01 for(Lead l : Trigger.new){
02 if(l.PostalCode != null){
03 List<Territory__c> terrList = [SELECT Id FROM Territory__c WHERE
PostalCode__c = :l.PostalCode];
04 if(terrList.size() > 0){
05 l.Territory__c = terrList[0].Id;
06 }
07 }
08 }
ANSWER FEEDBACK
A. 01: TRIGGER.NEW IS NOT VALID IN A Incorrect. You can use trigger.new in a before insert
BEFORE INSERT TRIGGER. trigger.
B. 02: A NULLPOINTER EXCEPTION IS Incorrect. This will not happen because in line 2, the code
THROWN IF POSTALCODE IS NULL. is making sure PostalCode is not null.
D. 05: THE LEAD IN A BEFORE INSERT Incorrect. The lead fields in a before insert trigger can be
TRIGGER CANNOT BE UPDATED. updated.
14
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 3
A developer needs to automatically populate the ReportsTo field in a contact record based on the values of the
related Account and Department fields in the contact record. Which two trigger types should the developer
create? (Select two answers.)
ANSWER FEEDBACK
15
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 4
A hierarchy custom setting stores a specific URL for each profile in Salesforce. Which statement can a
developer use to retrieve the correct URL for the current user’s profile and display this on a Visualforce Page?
ANSWER FEEDBACK
16
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 5
In which order does Salesforce execute events upon saving a record?
ANSWER FEEDBACK
17
Platform Developer I Certification Prep: Process Automation and Logic
B. BEFORE TRIGGERS; VALIDATION RULES; AFTER Inorrect. Once the after triggers are
TRIGGERS; WORKFLOW RULES; ASSIGNMENT RULES; executed, the assignment rules
COMMIT execute.
C. VALIDATION RULES; BEFORE TRIGGERS; AFTER Incorrect. Once the after triggers are
TRIGGERS; WORKFLOW RULES; ASSIGNMENT RULES; executed, the assignment rules
COMMIT execute.
D. BEFORE TRIGGERS; VALIDATION RULES; ASSIGNMENT Incorrect. There are validation rules that
RULES; WORKFLOW RULES; AFTER TRIGGERS; COMMIT happen before the before triggers
execute that are system level
validations, this includes page level
validations and field length checks.
Once the after triggers are executed,
the assignment rules execute.
18
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 6
How can a developer determine if a CustomObject__c record has been manually shared with the current user
in Apex?
ANSWER FEEDBACK
A. BY CALLING THE PROFILE SETTINGS OF THE CURRENT Incorrect. Profile does not provide
USER record sharing information.
C. BY CALLING THE ISSHARED() METHOD FOR THE Incorrect. The isShared method does
RECORD not exist for this functionality.
19
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 7
A developer creates a workflow rule declaratively that changes the value of a field on an object. An Apex after
update trigger exists for the object. What happens when a user updates a record?
ANSWER FEEDBACK
D. BOTH THE APEX TRIGGER AND WORKFLOW RULE ARE Incorrect. The workflow rule is fired
FIRED ONLY ONCE. once, but the trigger is executed twice.
20
Platform Developer I Certification Prep: Process Automation and Logic
Scenario 8
A developer wants to display all of the available record types for a Case object. The developer also wants to
display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom
Visualforce page.
Which two actions should the developer perform to get the record types and picklist values in the controller?
(Select two answers.)
ANSWER FEEDBACK
21
Platform Developer I Certification Prep: Process Automation and Logic
Read the question or term on each card, then click the card to reveal the correct answer. Click the right-facing
arrow to move to the next card, and the left-facing arrow to return to the previous card.
Question/Term Answer/Definition
A developer writes a before insert
trigger. Which context variable
can the developer use to access The Trigger.new context variable
the incoming records in the
trigger body?
22
Platform Developer I Certification Prep: Process Automation and Logic
Related Badges
Module
Lightning Flow
Module
Apex Triggers
Superbadge
Apex Specialist
Congratulations! You’ve studied up on the process automation and logic section of the Platform Developer I
certification exam.
23