Activity Forums Salesforce® Discussions What are the different types of object relations in salesforce? How can you create them?

  • What are the different types of object relations in salesforce? How can you create them?

    Posted by Marziya on February 6, 2020 at 2:22 pm

    What are the different types of object relations in salesforce? How can you create them?

    Deepak replied 4 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Deepak

    Member
    February 6, 2020 at 2:39 pm

    Hi Marziya!

    Object Relationships in Salesforce:

    A relationship is a two way association between two objects.

    Relationships allow us to create links between one object and another. Salesforce platform supports following relationship types

    1. Master-Detail relationship
    2. Lookup relationship
    3. Many-to-Many relationship

    Master-Detail (1:n)

    A parent-child relationship in which the master object controls certain behaviours of the detail object.

    When a record of the master object is deleted, its related detail records are also deleted.
    The Owner field on the detail object is not available and is automatically set to the owner of its associated master record. Custom objects on the detail side of a master-detail relationship cannot have sharing rules, manual sharing, or queues, as these require the Owner field.
    The detail record inherits the sharing and security settings of its master record.
    The master-detail relationship field is required on the page layout of the detail record.
    By default, records can’t be re-parented in master-detail relationships. Administrators can, however, allow child records in master-detail relationships on custom objects to be re-parented to different parent records by selecting the Allow re-parenting option in the master-detail relationship definition.

    Lookup Relationship (1:n)

    1. Child row not automatically deleted when a parent row is deleted
    2. No inherited sharing.
    3. 25 lookup relation relationships allowed per object.
    4. Lookup field on child not necessarily required.

    Many-to-Many(n:n)

    We can use master-detail relationships to model many-to-many relationships between any two objects. A many-to-many relationship allows each record of one object to be linked to multiple records from another object and vice versa.

    To create a many-to-many relationship, simply create a custom junction object with two master-detail relationship fields, each linking to the objects you want to relate.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos