💃Build a relationship with Salesforce🕺

🙅Not that kind of relationship🙅

Good morning, Salesforce Nerds! 🌄 Creating custom objects and relating them to each other is one of the fundamental responsibilities of Salesforce professionals. ✅ 

Whether we need to extend the functionality of an existing process or help build out a new one 💥 - the chances are high it will involve new objects and/or fields.

No doubt that you’ll also need to assess how to relate all these new objects together and how they’ll fit into your existing data model. 💯 

Today, let’s check out some of the different relationship types Salesforce offers and what the implications of using (or misusing 🫠) can be.

Agenda for today includes

  • Build a relationship with Salesforce

  • Daily Principle

  • All the Memes

Build a relationship with Salesforce

👀 Lookup

The most commonly used relationship type. For good reason! 🤙 This is how you construct a loosely-coupled, one-to-many relationship between two objects.

What’s loosely-coupled and why choose a Lookup? 🤔 

A loosely-coupled system is one where components are weakly associated and have little to no reliance on other components. 🎆 

Thinking about this from the perspective of our data model, this means selecting a lookup creates a breakable relationship 💔 (weakly associated) between our two objects.

By nature, this also means each object in this relationship is capable of existing in our org all on it’s own. 💪 They have their own sharing settings, security controls, and the deletion of one does not need to impact the other (unless you config it that way).

🫡 Master-Detail

Another one I’ve seen used over the years. Often misused, too. 😠 Relating objects in a master-detail relationship will tightly-couple them.

First loose-coupling and now tight-coupling? 🤔 

A tightly-coupled system is straight up the opposite of loosely-coupled. Strong association. Heavy or total reliance on other components. 🫢 

From our angle, that means selecting a master-detail creates a relationship that can’t be broken 🔗 AND the all of the objects can’t exist on their own (no way to config your way out of this one). 🤝 

This means detail records cannot exist without their master record 😰 If you delete the master record, then you just Thanos snapped the detail records. Detail records inherit sharing & security settings from their master record as well. Don’t get me started on re-parenting. 😭 

📋️ Many-to-Many

The only way to create a relationship between two objects that allows many of one to relate to many of the other. 🤘 

This is achieved through the use of a junction object. 🔥 

This object sits in the middle of the two you want to relate. All you do is configure it to be the detail in a master-detail relationship with the other two objects. ⏩️ 

If you find yourself tempted to add multiple looks to the same object then take a look at these. Duplicating lookups will get messy fast! 🛑 

🤳Self

This is just an object with a Lookup to itself. This will help you group an object into a loosely-coupled parent/child relationship. 🪞 

A common example is the Campaign Hierarchy. This object natively looks up to itself so you can group & associate marketing campaigns! 💥 

Daily Principle

"Pay attention to what’s in front of you - the principle, the task, or what’s being portrayed."

Marcus Aurelius

and now....Your Daily Memes

What did you think about today's newsletter?

Login or Subscribe to participate in polls.