Platform Developer I Webinar (Certification Week)
Platform Developer I Webinar (Certification Week)
https://help.salesforce.com/articleView?id=process_which_tool.htm&type=0
https://developer.salesforce.com/docs/atlas.en-
us.salesforce_vpm_guide.meta/salesforce_vpm_guide/process_which_tool.htm
https://trailhead.salesforce.com/en/content/learn/modules/business_process_automation/process_whichtool
Note: Lightning Flow is the current term Salesforces uses to reference the product that sits behind the Process Builder
and Cloud Flow Designer interfaces. (Hence why Process Builder processes and 'visual workflows', as they used to be
called, are both listed as being a FlowDefinition metadata type.)
Trailhead Homework
Module 3: Database Modeling and Management
Q1: Objects, relationships, and fields
Q2: No
Q3: Lookup
Q4: Account lookup on contact
Foreign key of the detail (i.e. the lookup to the master) is always required.
Lookup vs Master-Detail
* The parent field on a child can be required in a lookup relationship if you configure the field using the Required
checkbox, but it is not a system requirement.
Review: Data Loading Tools
Schedule imports N Y
Trailhead Homework
Modules 4-5: Logic and Process Automation (Parts 1 & 2)
A list is an ordered, indexed collection of elements. (Ordered means each is assigned a number to sort. Indexed means
that you can use that number to 'select' a specific record.)
A set is an unordered collection of elements that does not contain duplicates. (Can't use .get(0) for example)
A map is a collection of key value pairs where each unique key maps to a single value.
Q1 Answer: 3
Q2 Answer: 2
Q3 Answer: No, inserted duplicate values
Q4 Answer: 3
Answer: They all generated the same result in the debug log.
Apex Resources
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_core_concepts.htm
https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/langCon_apex_loops_for_SOQL.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_loops_for.htm
You have to specify a field in the SOQL 'SELECT' clause in order to reference that data later in your code.
Answer: SELECT Id, CaseNumber, Subject FROM Case WHERE Subject LIKE '%printer%'
Use a colon (:) before a variable if including in a SOQL query:
If you need to change more than just a value (variable), then you need dynamic SOQL (Database.query method).
SOSL only allows you to search text fields (including email and phone numbers).
SOQL SOSL
You want data from one object or multiple related objects (using joins). Y N
You don't know which object or field the data resides in. N Y
SOQL Resources
https://resources.docs.salesforce.com/sfdc/pdf/salesforce_soql_sosl.pdf
Note that the AllorNone parameter in Database.insert defaults to TRUE (if you do not specify a value).
Working with Exceptions and Governor Limits
Limits class with methods such as .getLimitQueries() [how many can happen] and .getQueries() [how many have
happened]. Subtract to get the number of, in this case, queries available.
These methods exist for each limit type. Some common limits:
Q1 Answer: 100
Q2 Answer: Yes, because the limit is 100
If updated to i < 300, we'd get a Too many SOQL queries: 101 exception, because the limit is 100.
The only way to avoid a governor limits exception is to write code properly .
A: no exception, list has no elements (code is a waste of time though)
B: will fail with error that Last Name is required
C: list with an element that is null will fail
D: governor limit exception [Should NOT do DML operations in a For loop]
E: will fail with error that LastName character limit is 80
Works fine with a small number of contacts (DML limit for single transaction is 150). Still, should NOT ever perform a
DML operation in a For loop.
Should not put DML inside a For loop or outside a For loop (memory limits). Instead put 'in the middle'.
Clarification from the Chatter Group on the "DML in the middle" solution:
Salesforce Limits Resources
http://resources.docs.salesforce.com/216/9/en-us/sfdc/pdf/salesforce_app_limits_cheatsheet.pdf
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm
https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/apex_methods_system_limits.htm
https://resources.docs.salesforce.com/210/latest/en-us/sfdc/pdf/limits_limitations.pdf
Trailhead Homework
Classes should contain business logic. Triggers should just 'direct traffic' to various classes.
Test generation classes are public so can be used by multiple (private) test classes.
Global also used by managed packages that want to give customers an "API" into the package code base.
"without sharing" ignores the access defined by the sharing model (all of the above).
'before' trigger: set default values, data validation, etc. (usually used to update the current record)
'after' trigger: used to access field values, so usually used to update other records
Q1 Answer: Course_Delivery__c
Q2 Answer: start date added or changed and record saved
Q3 Answer: before trigger
Q4 Answer: save record or show an error
Trigger.old (in above code sample) is a null list.
Trigger Resources
https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/apex_triggers_context_variables.htm
https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/apex_triggers_context_variables_considerations.htm
Describing the Save Order of Execution
Answer: Workflow rule and roll-up summary field (formula is calculated on read, not save).
Answer: before trigger
Order of Execution - Resources
https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
https://eltoroit.herokuapp.com/Blog.app?page=ArWeRuShD
Trailhead Homework
Module 6: User Interface
Three options:
1. Standard
2. Custom
3. Hybrid ("controller extension" - enhance the standard)
Can override standard action, add a custom VF button, or include inline on a page layout only if VF age uses the standard
controller for that object [Spoiler alert: That means you have to use a controller extension for additional functionality.]
Standard controller can only go down 1 level and up 5 levels (object relationships).
The Id in the URL must match the object specified in the standard controller.
Edit is a method from a standard controller.
Save navigates you back to the detail view of the page; Quicksave leaves the user on the edit page after completing the
save.
Formulas can go 10 levels up and 0 down. Code can go 5 levels up and 1 level down.
Scenario 1: Custom controller?
Scenario 2: Controller extension
Scenario 3: (progresses through screens for different objects) Custom controller?
Scenario 4: Controller extension
Working with the Lightning Component Framework
The 75% coverage requirements is overall coverage, so you could classes without any code coverage. (All triggers must
have at least one line covered by tests.)
Note: In older versions of the API (prior to v. 26, Dennis Goldwater approximated), tests did not have to be in separate
test classes, which is why you may see some old classes where @isTest demarcates a method within the class being
tested.
Creating Test Data and Tests
Solution: Add an Id field with fake values (has to exist as the Id on the parent and as a foreign key column on the child).
Salesforce generates a 'background' map and can reference the foreign key provided in the CSV to find the actual Id.
@testSetup annotation: before you run any test method in your class, that testSetup method is going to run (usually to
create data). A copy of the data created in the Test Factory method will be passed into each test method
Rarely you need access to your database, such as in the case of permission sets. In this case, use seeAllData = True (but
this should be very rare).
Best practice/recommendation: Name test classes the same as the class being tested with the suffix "_Test".
Executing a Test
Testing Considerations
Trailhead Homework
Salesforce DX is not on the exam.
Debugging
Deployment
Current: Winter '19 (API version 44)
Note: If the name of a piece of metadata is changed (in a sandbox), a changeset will not update the name in Production
but create a new piece of metadata instead.
Trailhead Homework
http://sfdc.co/certificationday