0% found this document useful (0 votes)
744 views60 pages

Platform Developer I Webinar (Certification Week)

The document provides information about a webinar for the Platform Developer I certification. The webinar will cover topics like Salesforce fundamentals, database modeling, logic and process automation, Apex classes and triggers. It includes modules, instructor details, knowledge checkpoints, and resources.

Uploaded by

lear forever
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
744 views60 pages

Platform Developer I Webinar (Certification Week)

The document provides information about a webinar for the Platform Developer I certification. The webinar will cover topics like Salesforce fundamentals, database modeling, logic and process automation, Apex classes and triggers. It includes modules, instructor details, knowledge checkpoints, and resources.

Uploaded by

lear forever
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Platform Developer I Webinar (Certification Week)

Tuesday, October 23, 2018


12:01 PM

Platform Developer I Study Cohort chatter group:


https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A000000PfbMSAS

Platform Developer 1 Credential trailmix:


https://trailhead.salesforce.com/users/00550000006yDdKAAU/trailmixes/prepare-for-your-salesforce-platform-
developer-i-credential

Instructor: Andres Perez

Module 1: Introduction to the Course and the Exam


Module 2: Salesforce Fundamentals
Q1 Answer: Model
Q2 Answer: View
3 releases each year: Spring, Summer, Winter

Code in Apex, Visualforce, Lightning Components, etc.

Knowledge Checkpoint: Declarative Process Automations

Process Builder Visual Workflow Workflow Approvals

Supports a time-based action Y Y Y N

Supports user interaction N Y N N

Can call Apex code Y Y N N

Can delete a record N Y N N

Process Automation Resources

 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

Lookup Relationships Master-Detail Relationships

Parent field on child is required N* Y

Access to parent determines access to children N Y

Deleting the parent always automatically deletes children N Y

Lookup field on page layout depends on required optional Y N


choice

* 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

If you want to… Data Import Wizard Apex Data Loader

Import fewer than 50,000 records Y Y

Prevent duplicates when importing new records Y N

Choose whether or not to trigger workflow rules Y N

Load up to 5,000,000 records N Y

Load objects such as products or opportunities N Y

Schedule imports N Y

Save mappings for later use N Y

Export or delete data N Y

Q1 Answer: Apex Data Loader


Q2 Answer: Data Import Wizard
A3 Answer: Accounts, so that you can reference their Ids when importing the Contacts

Trailhead Homework
Modules 4-5: Logic and Process Automation (Parts 1 & 2)

Working with Formula and Roll-up Summary Fields

Formula is only calculated when the record is fetched.


Roll-up Summary fields available on master records only: Count records or calculate sum, min, or max of aggregated
number field from child objects (may add filter)

Q1 Answer: Roll-up summary field on Contact to count Certification Held records


Q2 Answer: Formula field on Opportunity record to pull Industry field from related Account
Working with Basic Constructs in Apex

Apex is an object-oriented programming language.


ID data type will compare 15 and 18 digit IDs successfully.
A primitive is what Salesforce calls variables.

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

Working with SOQL

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).

Working with SOSL


Note that the result is a list of list objects (because results return for more than 1 object).

SOSL only allows you to search text fields (including email and phone numbers).

Knowledge Check: SOQL vs. SOSL

SOQL SOSL

You want to count the number of records meeting criteria. Y N

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

You want to sort results as part of the query. Y N

You want data from number, date, or checkbox fields. Y N

SOQL Resources

 https://resources.docs.salesforce.com/sfdc/pdf/salesforce_soql_sosl.pdf

Working with DML

1. B (Update), 2. A (Insert), 3. D (Delete), 4. C (Upsert), 5. E (Undelete)


For the stand alone DML above, because the Contact 'noName' is invalid, none of the records will be updated.

Note that the AllorNone parameter in Database.insert defaults to TRUE (if you do not specify a value).
Working with Exceptions and Governor Limits

Unrecoverable exceptions cannot be 'caught' in a Try-Catch block.

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

[May have missed one slide with Exam Objectives here]


Working with Apex Classes

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.

Test code coverage required 75%

Not shown: Abstract classes


Constructor methods have the same name as the class and do not have a return type.

Global also used by managed packages that want to give customers an "API" into the package code base.

Answer: "with sharing"


3 Components of the Sharing Model
 Object level security (CRUD)
 Record level access
 Field level security

"without sharing" ignores the access defined by the sharing model (all of the above).

Working with Apex Triggers


Answer: after trigger

'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

Working with Visualforce

Similar to HTML (or more accurately XML)


Make sure to write proper code (close out your tags and in the correct order)
Try to avoid Visualforce inside of Lightning. It works, but Lightning Components work much better.
Working with Visualforce Controllers

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).

Page One Answer: Only if the Visualforce page is on the Delivery


Page Two Answer: Requires custom controller b/c need to go 2 levels down (note below)
Page Three: Possible from Contact
There are standard controllers even for custom objects (what is standard here is the controller, not the model).

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

Options to access data


 Apex controller (multiple records)
 Lightning Data Services (one record)
Trailhead Homework
Module 7: Testing

Describing the Testing Framework and Requirements

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

Test.loadData loads tests data from a CSV in Static Resources.


 Saves time
 More realistic data
 Doesn't rely on existing data that could be changed (and cause the test to fail)
One problem: Puts CSV into data list and they get created. If you have a master detail, have to have the foreign key (Id
of master/parent) on create.

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

startTest and stopTest extend your limits


No test data is ever committed; all of it is rolled back at the end of the test.
Future methods or asynchronous Apex: Become synchronous at stopTest and are executed so you can evaluate result.

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

Module 8: Certification Preparation Resources

http://sfdc.co/certificationday

You might also like