Relationships in Sales force
What is Lookup Relationship in sales force?
Look Up Relationship or One to Many Relationships: A look up is a loosely coupled relationship, allowing you to connect one object to another in a one to many fashion. Child sharing is not dependent of the parent. it can have it's own sharing
What is Master Detail Relationship?
Master Detail Relationship: It is strongly coupled relationship. In this One object acts like a Master(Parent) and another object acts like Detail(Child). When the Parent record is deleted it's child record also gets deleted.
we can define relationship between two custom objects and standard and custom objects.
We can also have a roll up summary field in this relationship which help us calculate the values from child record by using aggregate functions like count, sum, min, max.
Parent record is required in child record's page layout. we can create 2 relationships per object.
The owner field is not available in child object and it is automatically set it's related parent record owner only
If we are having custom object is child then can't have sharing rules, manual sharing, queues as the require the Owner field.
Also we can't create this relationship in which the user or lead objects are the masters
What is Many to Many Relationship?
Many To Many Relationship: In this Relationship records of particular objects are linked to multiple records of different objects and vice versa.
There is no such field as a many-to-many relationship in Sales force, we can create a many-to-many relationship by creating two master-detail relationships with a common object.
This common object can also be specified as the "junction object".
What is Self Relationship?
Self-relationship simply means creating a relationship with itself.
In this, we can relate an object with itself by look-up.
Example: Account object has a field called Parent Account which shows the self-relationship in Account
What is External look up relationship?
This is a new field type that has been introduced with Sales force Connect. To link an external object to another external object, we use the external relationship field.
It supports standard look-up relationships that use 18 characters Sales force Id for the association.
it is new type of relationship with sales force connect
This relationship can link to external object
What is Hierarchical Relationship?
Hierarchical Relationship: it is available only user object
Note: One to One: one to one relationship we can do two ways configuration and by using apex trigger.
What is the difference between "Self and Hierarchical Relationships?
Self Relationship - A self relationship creates a tree diagram of the objects. For example, the account has a lookup on himself, called Parent Account.
Hierarchical Relationship - On the user object a special self-relationship called the hierarchical relationship helps create superior roles such as supervisor, manager on user object.
How do we create relationship fields. or which object we can create relationship fields?
First we have to identify which one is parent and child object. Then we should always create relationships from child object
can we create look up relation ship on an object which already having existing data?
Yes we can
A roll up summary option is disabled in one of the objects. What is the reason?
Either objects is having look-up relationship with other objects or it doesn't have any relationship with other objects
can we create a roll-up summary or mimic roll-up summary functionality on a lookup?
No and Yes
we can't do with customization but we can do by using triggers
Difference between Look Up and master detail relationships?
What is Account and Contact Relationship?
The Account-Contact relationship is a standard relationship: It is a little like lookup, a little like Master-Detail, but fundamentally behaves the way it does because we decided it should.
Can we create a lookup and master detail field on a standard object?
Lookup - Yes
Standard objects can't be on the detail side of a custom object in a master-detail relationship.
How to identify which is primary and child objects?
The object which has lookup or master-detail field will be child and another will be parent.
Can lookup be converted to master detail?
Yes, but please insure that every record has its parent assign then you can convert look up into master details
Can we convert master detail into lookup?
Yes
Can you delete empty records and add Master-detail relationship after?
Yes
Is there a way to change filter logic as OR in roll up summary field?
No
What we can do if there are N no of records are there for converting lookup to MD?
Through some automation you need to populate parent record on each record where lookup field is blank then only you can convert lookup field into master-detail.
What is difference between , if we create Lookup Relationship with required and MDR?
If you create a lookup with required then you won’t be able to delete parent record,
But in MDR it is by default required but still you will be able to delete parent and child will be deleted as well.
Note: This Scenario doing by using page layout it will not consider this condition, it won't work
master(custom object)--->child(standard object ) is it possible?
No
can you make roll up with picklist or check box?
No
How many roll up summary can be created in an object?
25
where can we reach the bin?
It is available under each object as “deleted fields”
can we create junction object with 3 master detail object ?
No
What does it mean field to aggregate in roll up summary field in simple words?
To select which field value will be added or calculated as max/min on parent record
if suppose we have 2 objects of one child. if one object is deleted what will happen?
Deleted object records will be deleted from child object
While conversation of lookup to master if u have 15k records in particular object ,how to fill the lookup field? Or One by one or we have any other way??
Through Automation Flow or Trigger
Is there any standard junction object in sales force
Yes
can we use more then one junction object in single project ?
Yes
If a junction object has two parents, which parents properties or security will the junction object take?
The one which is created first
Can a child record be a master to some other object?
No
Can we create a Master-Detail relationship field on the standard object?
No
What is the Security sharing on the master-detail relation?
if we are creating this relationship. child will depend parent only. in OWD controlled by parent will be visible
What is Primary Key?
It resides on the table which is one in a many to one relationship.
What is Foreign Key?
It resides on the table which is many in a many to one relationship.
What is Primary Master?
It is the relation created first with any of the two master objects.
The object with which the relationship is created first is called the "primary master object"
What is Secondary Master?
The second master-detail relationship created with another master object.
The object with which the relationship is created first is called the "secondary master object"
We need to delete the child records automatically when I deleted the parent record. How is this possible?
The objects must be in master-detail relationship.
What is Junction Object?
A junction object in Sales force is a custom object that is used to establish a many-to-many relationship between two objects
Suppose you have a standard object called "Contact" and a custom object called "Event."
You want to track which contacts are attending which events.
To do this, you create a custom junction object called "Event Attendee."
The Event Attendee object has two master-detail relationships: one to the Contact object and one to the Event object.
You create a record in the Event Attendee object for each attendee, with the Contact record as the parent in one master-detail relationship and the Event record as the parent in the other.
If the junction object contains 200 records related to a parent can we delete a corresponding parent?
No We can't able to delete
Can we provide users only edit access to detail object?
It is not possible. User must have at least read access to master object to have an access on child
Is it possible to convert Mater – Detail Relationship to Look Up Relationship?
If the parent object doesn’t have Roll up Summary fields for the child object then we can convert.
What is a Record Owner?
The User or Queue who controls and have the right to access a record.
Generally there are two types of Owners. They are
Users.
Queues.
What do Master-Detail relationships will involve?
Cascading deletes and sharing rules which are controlled by the parent
What will happen if we undelete the deleted Junction Object?
Master – Detail Relationship data types will be converted to look up relationship data types.
What happens when we retrieved relation ship records from recycle bin will it retrieve relationship Id as well in Both lookup and master detail?
Yes
What is Cross Object Formula Field in Sales force?
Cross Object Formula Fields span two related objects and reference merge fields on those objects. It can be referred to merged fields of parent objects on the child objects.
Cross Object Formula Field is available on both master-detail as well as lookup relationship.
Fields can be referred up to 10 relationships away. Cross Object formulas can be used everywhere except when creating default values
What is Lead Process?
To control the pick list values of the Status field on the lead object we should create lead process.
Without selecting the lead process we can't create the record type for lead object
What is Sales process?
To control the pick list values of the Stage field on the opportunity object we should create sales process.
Without selecting the sales process we can't create the record type for opportunity object