Lookup relationship related list Salesforce
Posted on July 27, 2021 The 6 Types of Relationships in SalesforceShare this article... Data relationships between objects in Salesforce can be a tricky topic to get your head around. You may be faced with a business scenario that requires creating a custom object, and then the next decision is which relationship types you should use to extend your Salesforce data model. Show This is a fundamental concept to learn, as it ensures that you pick the right relationship type that ensures a scalable data model. Lets dive in. 1. Lookup RelationshipsA Lookup is a loosely coupled relationship, allowing you to connect one object to another in a one-to-many fashion. In this example, you can see that an Asset may be involved with a number of cases. In this scenario, if the case is deleted, the Asset will remain and vice versa. 2. Master-Detail RelationshipA master-detail relationship is a strongly coupled relationship, meaning if the parent is deleted, so are the child records. This is a good thing and can be incredibly helpful. This relationship seems to scare people, but it shouldnt! Master-detail also allows the parent record to control child record attributes such as sharing and visibility. Whichever security setting you chose for the parent record, the child record inherits. In this example, you have a list of rooms in which employees can book out for meetings. However, should the room be deleted, what use would the meetings be? None, so they go too. However, when creating a master-detail relationship, you can check a box to allow reparenting so you could be kind and allow them to select a new room! The sweet spot with Master-detail relationships is that you can create rollup summary fields! Do take note, a single object can have a maximum of 2 master-detail relationships. Lookups vs. Master-Detail Relationships
3. Many-to-Many RelationshipsSay you have a situation where it is required you have many of one record related to many of another. Duplicating that lookup field a number of times on each object is not best practice and will get very messy. This is where we should leverage Junction Objects. In the image below, we see that a session can have multiple speakers but also speakers can present at multiple sessions. A perfect place to add that junction object of Session Speaker in between to handle this relationship! Read More: What is a Junction Object in Salesforce? 4. Self RelationshipLets say, for example, you have a Campaign. This campaign is part of a bigger campaign. You can use a lookup field from campaign to campaign! Why? This would be a great situation to show how multiple child campaigns relate to the main parent campaign (known as a Campaign Hierarchy). 5. External RelationshipsThere are two more types of Lookups for working with external objects we should cover briefly:
Read More: Introduction to Salesforce Connect for External Applications 6. Hierarchical RelationshipsA simple but commonly forgotten relationship in Salesforce is hierarchical. This unique relationship can only be used on the user object and is designed to create a hierarchy of users. For example, it could be used to create a lookup field for the user object, which can be used to list the users manager. SummaryLearning the different types of relationships in Salesforce and when to use them, is a core part of any professionals job. Hopefully, this article has given you a complete overview of the relationships, and when to use them. |