12 Mar 2016

Relationships in Salesforce

Relationships:
Relationships are used to  establish connection between two or more Objects.By these Relationships to avoid Data Redundancy and to achieve Integrity.
Relationships associate objects with other objects. For example, a relationship can link a custom object to standard object in a related list, such as linking a custom object called Bugs to cases to track product defects associated with customer cases. 

Navigation:

Setup.....>Build....>Create.....>Objects....>Open the Existing Object.....>Fields and Relations....>Select New

Step1--->Select the Relationship type
Step2--->Enter the Field details
Step3--->Establish to the Field-Level-security
Step4--->Add the fields to Page layouts. 

Types of Relationships:

3 Types of Relationships

1.One-To-Many                               2.One-To-One                             3.Many-To-Many
  • Master-Detail                       ---->It is also called the                 ----->It is also called              
  • Lookup                                        Hierarchy Relation                          Junction Object.


Example:

Chatter Objects

Diagram showing the relationships between the Chatter objects
The following diagram shows the relationships between the major Chatter objects.
  • A feed item is an entry in the feed, such as a change to a record that's being followed, an updated post, or a user status change.
  • All feed items have a ParentId, which is either:
    • the record that is changed
    • the user who received the post
ERD of Chatter, general