Salesforce Developer Tutorial - How and When to use Apex Managed Sharing

In this episode we go over what Apex Managed Sharing is in Salesforce, when you you should actually use apex managed sharing and how to actually write code to produce custom apex shares for both standard and custom objects! Schedule Salesforce consulting time with me here: https://calendly.com/codingwiththefor... 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 - Intro 0:18 - What we'll cover in this video 0:39 - What is Apex Managed Sharing? 1:47 - When should you use Apex Managed Sharing? 4:11 - Why should you use Apex Managed Sharing? 5:17 - How to create and Apex Sharing Reason 8:26 - How to create a share record for Custom Objects in Apex 21:00 - Demonstrating the Dangers of using the Manual Share Reason on Standard and Custom Objects. 24:10 - Creating a share record in Apex for Standard Objects 26:40 - Demonstrating the danger of creating apex shares for record owners 28:54 - How to address the problem of manual share reasons being the only option for programmatic shares on standard objects 31:12 - 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

Salesforce Developer Tutorial: How to use Named Credentials to simplify your Apex Integrations
▶︎

Salesforce Developer Tutorial: How to use Named Credentials to simplify your Apex Integrations

Salesforce Developer Tutorial (LWC) - The Complete Guide to LWC Lifecycle Hooks
▶︎

Salesforce Developer Tutorial (LWC) - The Complete Guide to LWC Lifecycle Hooks

How To Use Streak CRM: Full Tutorial For Beginners
▶︎

How To Use Streak CRM: Full Tutorial For Beginners

Design Patterns in Salesforce (Ep. 2) - What is Object Oriented Programming (OOP)?
▶︎

Design Patterns in Salesforce (Ep. 2) - What is Object Oriented Programming (OOP)?

Salesforce Development Tutorial - A Complete Guide to Exception Handling in Apex and LWC's
▶︎

Salesforce Development Tutorial - A Complete Guide to Exception Handling in Apex and LWC's

Turing Award Winner: Disagreeing with Google, Postgres, Future Problems | Mike Stonebraker
▶︎

Turing Award Winner: Disagreeing with Google, Postgres, Future Problems | Mike Stonebraker

England - Argentinien, Highlights mit Livekommentar | FIFA WM 2026 | MAGENTA TV
▶︎

England - Argentinien, Highlights mit Livekommentar | FIFA WM 2026 | MAGENTA TV

Salesforce Developer Tutorial: How and When to use Interfaces In Apex
▶︎

Salesforce Developer Tutorial: How and When to use Interfaces In Apex

Complete Terraform Course - From BEGINNER to PRO! (Learn Infrastructure as Code)
▶︎

Complete Terraform Course - From BEGINNER to PRO! (Learn Infrastructure as Code)

Basics of CPQ | What is CPQ | CPQ Demo | getting Started with CPQ
▶︎

Basics of CPQ | What is CPQ | CPQ Demo | getting Started with CPQ

Design Patterns in Salesforce (Ep. 3) - What is Encapsulation?
▶︎

Design Patterns in Salesforce (Ep. 3) - What is Encapsulation?

Salesforce Apex Master Class (Ep. 29) - Collection Iteration in Apex (How to Write For Loops)
▶︎

Salesforce Apex Master Class (Ep. 29) - Collection Iteration in Apex (How to Write For Loops)

Salesforce Development Tutorial - A Complete Guide To Asynchronous Apex in Salesforce
▶︎

Salesforce Development Tutorial - A Complete Guide To Asynchronous Apex in Salesforce

Scott Ritter: Russland gewinnt den Krieg – und das eindeutig
▶︎

Scott Ritter: Russland gewinnt den Krieg – und das eindeutig

Salesforce Apex Master Class (Ep. 20) - What is the Static Keyword in Apex?
▶︎

Salesforce Apex Master Class (Ep. 20) - What is the Static Keyword in Apex?

China Is About To Pop The AI Bubble
▶︎

China Is About To Pop The AI Bubble

Salesforce SoC and Apex Common Tutorial Series: Ep 2 - Introduction to the Apex Common Library
▶︎

Salesforce SoC and Apex Common Tutorial Series: Ep 2 - Introduction to the Apex Common Library

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup
▶︎

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

RL for Agents Workshop - Deep Dive on Training Agents with RL and Open Source
▶︎

RL for Agents Workshop - Deep Dive on Training Agents with RL and Open Source

Salesforce Developer Tutorial - How and When to use the Platform Cache in Salesforce
▶︎

Salesforce Developer Tutorial - How and When to use the Platform Cache in Salesforce