Relationship in Salesforce
What are different type of Relationship
1)Master Detail relationships
2)Lookup relationship
3)Many to Many Relationship
4)Hierarchichal Relationship
5)Self Relationship
1)Master Detailed Relationship-
Master Detailed is parent child relationship . Parent represent master side and child represents Detailed.
In Master Detailed relationship is tightly coupled.tightly coupled means when parent get deleted cascading child get deleted.
In Master Detailed relationship Rollup summary field is present on Master side.
Rollup summary field means SUM,MIN ,MAX, COUNT pf the child records.if record exist in details(child) object,then we can not create a Master-Details relationship with a Master(Parent) object.
Up to 2 master-details relationships allowed per object.
2)Lookup Relationship.-
lookup relationship is parent child relationship.
Parent field on child is not a required.
if parent get deleted, then its associated child will not get deleted.
Rollup summary field is not required in Lookup relationship.
If record is exists in child object, then also we can create a Lookup relationship with a parent.
Maximum 40 lookup relationship can created per object. if master details=1 then lookup= 39.
Many to Many Relationship(Junction object)-
A many to many relationship occurs when multiple records in a table are associated with multiple records in another record.
In junction object two object connected with third object.
Self Relationship-
A self-Relationship in salseforce is a lookup relationship to the same object. It creates a tree diagram of the objects. It creates a tree diagram of the objects. Suppose we order some product from an online store, but we have not got the right product at the moment of delivery.
Hierarchichal Relationship.-
This is unique lookup relationship that only the user object can have.
It enable users to associate one person with another without referring to themselves directly or indrectly using a lookup field.
Subscribe to my newsletter
Read articles from shubham giri directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by