Professional Documents
Culture Documents
Key Topics
This module prepares you for the logic and process automation section of the Platform Developer I exam. The
logic and process automation section, which makes up 46% of the overall exam, tests 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 logic
and process automation 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 logic and process automation. This unit focuses on the basic constructs in
Apex, formulas, and rollup summary fields.
1
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 1
Which three statements are true regarding cross-object formula fields? (Select three answers.)
ANSWER FEEDBACK
A. FORMULA FIELDS CAN REFERENCE Correct. A cross-object formula can reference merge
FIELDS FROM MASTER-DETAIL OR fields from a master (“parent”) object if an object is on
LOOKUP PARENT RELATIONSHIPS. the detail side of a master-detail relationship. A cross-
object formula also works with lookup relationships.
B. FORMULA FIELDS CAN REFERENCE Incorrect. Formula fields cannot access a collection of
FIELDS IN A COLLECTION OF RECORDS records. You can perform actions on a collection of child
FROM A CHILD RELATIONSHIP. records using roll-up summary fields.
C. FORMULA FIELDS CAN EXPOSE DATA Correct. Formula fields can expose data that the user
THE USER DOES NOT HAVE ACCESS TO does not have access to. For example, if you create a
IN A RECORD. formula field on the Case object that references an
account field and display that formula field in the Case
page layout, users can see this field even if they don’t
have access to the account record.
D. FORMULA FIELDS CAN BE USED IN Incorrect. The only formulas you can use in roll-up
THREE ROLL-UP SUMMARIES PER summary fields are COUNT, SUM, MIN, MAX.
OBJECT.
2
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 2
In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of the
Estimated_Value__c currency field from the CampaignMember object using a roll-up summary field called
Total_Estimated_Value__c on Campaign. How is the currency of the Total_Estimated_Value__c roll-up
summary field determined?
ANSWER FEEDBACK
3
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 3
In which three locations can you create custom roll-up summary fields using Standard Object relationships?
(Select three answers.)
ANSWER FEEDBACK
A. ON ACCOUNT USING OPPORTUNITY RECORDS Correct. You can create roll-up summaries on
Accounts using the values of related
opportunities.
B. ON QUOTE USING ORDER RECORDS Incorrect. You can create roll-up summary fields
on any custom object that is on the master side of
a master-detail relationship or any standard object
that is on the master side of a master-detail
relationship with a custom object.
C. ON ACCOUNT USING CASE RECORDS Incorrect. You can create roll-up summary fields
on any custom object that is on the master side of
a master-detail relationship or any standard object
that is on the master side of a master-detail
relationship with a custom object.
D. ON CAMPAIGN USING CAMPAIGN MEMBER Correct. You can create roll-up summaries on
RECORDS Campaigns using campaign member status or
the values of campaign member custom fields.
4
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 4
An sObject named Application__c has a lookup relationship to another sObject named Position__c. Both
Application__c and Position__c have a picklist field named Status__c. When the Status__c field on
Position__c is updated, the Status__c field on Application__c needs to be populated automatically with the
same value, and execute a workflow rule on Application__c.
ANSWER FEEDBACK
A. BY USING AN APEX TRIGGER WITH A DML Correct. By using a trigger, you can easily
OPERATION update the picklist value on the parent by
doing an update on the parent record (hence
the DML operation).
B. BY CONFIGURING A CROSS-OBJECT FIELD Incorrect. Here, the status change is on the child
UPDATE WITH A WORKFLOW and it will be reflected on the parent. Instead, the
change should be made on the parent and
reflected on the child.
5
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 5
What should a developer do to update a picklist field on related opportunity records when a modification to the
associated account record is detected?
ANSWER FEEDBACK
A. CREATE A WORKFLOW RULE WITH A FIELD Incorrect. When using workflow rules, you can
UPDATE. only update the record or its parent.
D. CREATE A PROCESS WITH PROCESS BUILDER. Correct. Creating the process using Process
Builder helps the developer control the
schedule of the process. It also allows the
process to run as planned instead of doing
things manually.
6
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 6
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
B. WHILE (CONDITION) {...} Incorrect. For do while, while, and traditional for
loops, the developer must set the size value for
the exit condition to eventually be met.
C. FOR (INIT_STMT; EXIT_CONDITION; Incorrect. For do while, while, and traditional for
INCREMENT_STMT) { … } loops, the developer must set the size value for
the exit condition to eventually be met.
7
Platform Developer I Certification Prep: Logic and Process Automation
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 two users can edit a record An administrator and a user who is assigned
after it has been locked for approval? as the current approver
8
Platform Developer I Certification Prep: Logic and Process Automation
String x = 'A';
Integer i = 10;
if ( i < 15 ){
i = 15;
x = 'B';
‘B’
} else
if ( i < 20 ){
x = 'C';
} else {
x = 'D';
9
Platform Developer I Certification Prep: Logic and Process Automation
Related Badges
Looking for more information? Explore these related badges.
Module
Project
Visualforce Basics
Module
Module
10
Platform Developer I Certification Prep: Logic and Process Automation
You’ve reviewed the Salesforce fundamentals. Next, let’s take a look at data modeling and management.
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
11
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 1
A developer needs to create records for the object Property__c. The developer creates the following code
block.
Which line of code should the developer insert at line 03 to ensure that at least some records are created, even
if a few records have errors and fail to be created?
ANSWER FEEDBACK
C. Incorrect. System.ALLOW_PARTIAL
DATABASE.INSERT(PROPERTIESTOCREATE,SYSTEM.ALLOW_PA is not a valid parameter inside this
RTIAL); method.
12
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 2
A developer in a Salesforce org with 100 accounts executes the following code using the Developer Console .
Account myAccount = new Account(Name='MyAccount');
insert myAccount;
How many accounts are in the org after this code is run?
ANSWER FEEDBACK
13
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 3
Which two statements should a developer avoid using inside procedural loops? (Select two answers.)
ANSWER FEEDBACK
A. LIST<CONTACT> CONTACTS = [SELECT ID, SALUTATION, Correct. Avoid using SOQL in loops
FIRSTNAME, LASTNAME, EMAIL FROM CONTACT WHERE since there is a governor limit that
ACCOUNTID = :A.ID]; enforces a maximum number of
SOQL queries. When these
operations are placed inside a loop,
database operations are invoked
once per iteration of the loop making
it very easy to reach these governor
limits. Best practice is to query once
to obtain all results, and then iterate
over the results.
D. SYSTEM.DEBUG('AMOUNT OF CPU TIME (IN MS) USED Incorrect. System.debug is a great way
SO FAR: ' + LIMITS.GETCPUTIME()); to test the output especially in loops.
14
Platform Developer I Certification Prep: Logic and Process Automation
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
Delete acc;
2,150
Database.emptyRecycleBin(acc);
system.debug(Limits.getDMLStatements()+',
'+Limits.getLimitDMLStatements());
15
Platform Developer I Certification Prep: Logic and Process Automation
Related Badges
Looking for more information? Explore these related badges.
Module
Module
Great work! You’re almost finished reviewing the logic and process automation section of the Platform
Developer I exam. On to the last unit, which covers Apex classes and triggers.
16
Platform Developer I Certification Prep: Logic and Process Automation
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
17
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 1
What is an accurate constructor for a custom controller named MyController?
ANSWER FEEDBACK
ACCOUNT =
(ACCOUNT)STDCONTROLLER.GETRECORD();
ACCOUNTS = (LIST<ACCOUNT>)OBJECTS;
18
Platform Developer I Certification Prep: Logic and Process Automation
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.
C. 03: A SOQL QUERY IS LOCATED INSIDE Correct. This will fail on the record number 201
OF THE FOR LOOP CODE. because the limit of SOQL queries is 200. Best
practice is to avoid SOQL queries inside for loops.
D. 05: THE LEAD IN A BEFORE INSERT Incorrect. The lead fields in a before insert trigger can be
TRIGGER CANNOT BE UPDATED. updated.
19
Platform Developer I Certification Prep: Logic and Process Automation
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
20
Platform Developer I Certification Prep: Logic and Process Automation
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
21
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 5
In which order does Salesforce execute events upon saving a record?
ANSWER FEEDBACK
22
Platform Developer I Certification Prep: Logic and Process Automation
B. BEFORE TRIGGERS; VALIDATION RULES; AFTER Incorrect. 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.
23
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 6
A developer needs to create a Visualforce page that will override the standard Account edit button. The page
will be used to validate the account’s address using a SOQL query. The page will also allow the user to make
edits to the address. Where should the developer write the account address verification logic?
ANSWER FEEDBACK
24
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 7
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.
D. BY QUERYING THE ROLE HIERARCHY Incorrect. Role hierarchy alone does not
give enough information on sharing.
25
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 8
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
A. THE APEX TRIGGER IS FIRED MORE THAN ONCE. Correct. After the workflow rule, the
trigger is executed again.
B. THE WORKFLOW RULE IS FIRED MORE THAN ONCE. Incorrect. The workflow rule is only
executed once.
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.
26
Platform Developer I Certification Prep: Logic and Process Automation
Scenario 9
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?
ANSWER FEEDBACK
B. USE SOQL TO QUERY CASE RECORDS IN THE ORG Incorrect. This is unnecessary and very
TO GET ALL THE RECORDTYPE VALUES AVAILABLE inefficient since this information can be
FOR CASE. gathered using
Case.SObjectType.getDescribe().getRecordTy
peInfos().
D. USE SOQL TO QUERY CASE RECORDS IN THE ORG Incorrect. This is unnecessary and very
TO GET ALL VALUES FOR THE STATUS PICKLIST inefficient since this information can be
FIELD. gathered using
Case.Status.getDescribe().getPicklistValues().
27
Platform Developer I Certification Prep: Logic and Process Automation
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
28
Platform Developer I Certification Prep: Logic and Process Automation
Related Badges
Looking for more information? Explore these related badges.
Module
Lightning Flow
Module
Apex Triggers
Superbadge
Apex Specialist
Congratulations! You’ve studied up on logic and process automation section of the Platform Developer I
certification exam.
29