You are on page 1of 8

Object Relationships

A relationship is a bi-directional association between two objects. Relationships


allow us to create links between one object and another.

The platform supports following relationship types:


1. Master-Detail relationship
2. Lookup relationship
3. Many-to-Many relationship.
1. Master-Detail
A parent-child relationship in which the master object controls certain
behaviors 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.
 The detail record inherits the security and sharing settings of its
master record.
 It is tightly coupled relationship
2. Lookup Relationship
This type of relationship links two objects together but has no effect on
deletion or security.

 Child row not automatically deleted when a parent row is deleted


 No inherited sharing.
 25 lookup relation relationships allowed per object.
 Lookup field on child not necessarily required. 
 It is losly coupled relationship
3. Many-to-Many
You 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.
Data Security in Salesforce
 In Salesforce, data is stored in three key constructions: 
objects, fields, and records.
 Objects are similar to tables in databases. 
 Fields are similar to columns of the table. 
 Records are similar to rows of data inside the table
Field Level Security
 Field level security in Salesforce is configured for a user’s profile and permission
set.
 Using Field Level Security administrator can controls whether a user can see, edit,
and delete the value for a particular field on an object.

Record Level Security


It determines which individual records users can view and
edit in each object they have access to in their profile.
Salesforce provides 4 ways to implement it:

 Organization-Wide Default (OWD):


Organization-Wide default or Organization-Wide sharing settings determine
the baseline level of access for all records of an object.
Types: Public read/write, Public Read-only, Private, Public read/write
transfer.
 Role Hierarchy:
I. It Defines the hierarchy.
II. Users who tend to need access to the same types of records can be
grouped as Roles.
III. Users at any given role level can view, edit, and report on all data
owned by or shared with users below them in the role hierarchy.
 Sharing Rules:
I. These automatic exceptions to organization-wide defaults for
particular groups of users.
II. Sharing rule are only used to give additional users access to records.
III. They can’t be stricter than your organization-wide default settings.
 Manual Sharing:
In this records are shared individually with other users by using the share
button on the record. Sometimes it is not possible to define a consistent
group of users who need access to a particular record that is where manual
sharing comes in.
Only these 4 users can share the record:
Record Owner, A user in a role above the owner in the role hierarchy, Users
granted “Full Access” to record and Administrator.

You might also like