Salesforce Developer Tutorial - The Complete Guide to SOQL and SOSL in 2022!
Coding With The Force Coding With The Force
15K subscribers
16,926 views
468

 Published On Premiered Oct 26, 2022

In this episode we go over absolutely everything about SOQL and SOSL from beginner concepts to advanced concepts! So stick with me and I promise by the end you'll know all you need to know to write great SOQL queries as a developer on the Salesforce Platform!

GitHub Repo: https://github.com/Coding-With-The-Fo...

Query Plan Tool Documentation: https://help.salesforce.com/s/article...

Query and Search Optimization Cheat Sheet: http://resources.docs.salesforce.com/...

Please consider donating to help continue to improve the content produced for Coding With The Force: https://www.paypal.com/donate?busines...

Get Coding With The Force Merch Here: https://my-store-d20559.creator-sprin...

Follow all of our social media here:

Patreon:   / codingwiththeforce  
Github: https://github.com/Coding-With-The-Force
Facebook:   / codingwiththeforce  
Twitter:   / coding_force  
Instagram:   / codingwiththeforce  

Salesforce development books I recommend:

Advanced Apex Programming: https://amzn.to/3lXi8to
Salesforce Lightning Platform Enterprise Architecture: https://amzn.to/2R0D4BQ
Mastering Salesforce DevOps: https://amzn.to/3lTtTRN
Apex Design Patterns Book: https://amzn.to/3DwqljP


Good Non-SF Specific Development Books:

Clean Code: https://amzn.to/35PuMDU
Clean Architecture: https://amzn.to/35FYo6A
Design Patterns: Elements of Reusable Object-Oriented Software Book: https://amzn.to/3LhvHBd

-----------------------------------------------------------------------------------------------------------------------

Table of Contents:

0:00:00 - Intro
0:02:24 - Why do we use SOQL and SOSL?
0:03:50 - Is SOQL or SOSL the same as SQL?
0:04:52 - How to write a basic SOQL Query (The SELECT and FROM Clauses)
0:08:48 - How to find Object and Field API Names for your Queries
0:13:12 - How to Filter your SOQL Queries (WHERE Clause)
0:14:10 - Why care about Filtering a Query?
0:18:24 - Writing a Filtered SOQL Query (WHERE Clause)
0:21:25 - Logical Operators in SOQL
0:28:36 - Comparison Operators in SOQL
0:31:48 - The LIKE Comparison Operator
0:36:46 - The IN and NOT IN Comparison Operators
0:38:25 - The INCLUDES and EXCLUDES Comparison Operators
0:40:41 - Encrypted Field Issues in SOQL Queries
0:42:00 - The ORDER BY Clause
0:47:26 - The LIMIT Clause
0:49:31 - The OFFSET Clause
0:52:24 - Querying for Related Record Data (Lookup and Master Detail Fields)
0:53:20 - What are Lookup and Master Detail Relationship Fields?
0:55:38 - How to Query for Parent Record Data on a Standard Field (relationship fields)
1:00:00 - How to Query for Parent Record Data on a Custom Field (relationship fields)
1:03:50 - How to Query for Child Record Data (Inner Queries)
1:07:59 - How to use the Schema Builder to figure out Object Relationships
1:10:34 - The WITH SECURITY_ENFORCED SOQL Clause
1:11:58 - The USING SCOPE SOQL Clause
1:13:49 - The FOR VIEW, FOR REFERENCE and FOR UPDATE Clauses
1:17:50 - The FIELDS() Function in SOQL
1:20:16 - Aggregate Functions, the GROUP BY Clause and the HAVING Clause
1:29:29 - How to use SOQL in Apex
1:39:24 - How to use Bind Variables in SOQL
1:44:39 - How to use Dynamic SOQL in Apex
1:50:10 - Benchmarking SOQL Execution Times (Limits and Execution Overview)
1:59:42 - How and why to use the Query Plan Tool
2:09:50 - Big Object SOQL and Async SOQL
2:15:58 - What is SOSL?
2:19:21 - Building a basic SOSL Query (FIND , IN and RETURNING Clauses)
2:24:44 - The IN Clause
2:28:20 - RETURNING Clause and Object specific Query's
2:32:12 - The FIND Clause
2:40:44 - The toLabel() function, the USING Listview Clause. and the SPELL_CORRECTION Clause
2:43:20 - Using SOSL in Apex
2:49:45 - How to use Dynamic SOSL
2:52:47 - Protecting against SOQL and SOSL Injection
2:57:03 - Outro

DISCLAIMER: The views and ideas expressed on this YouTube channel and blog are based on past development experiences and may not always work for your particular scenarios. The advice in these videos may also become outdated as technology advances. They should be used as examples for educational purposes only. Using any shown solutions in your own org is not advisable since they are example scenarios.

#salesforce #salesforcedeveloper #salesforceadmin

show more

Share/Embed