How many relationships included in SFDC & What are they?
- We are having two types of relationships, they are
- Lookup Relationship
- Master-Detail Relationship
What is a “Lookup Relationship”?
This type of relationship links two objects together,
- Max. number of Relationship Fields per an object: 40 (Increased from 25 to 40 in Summer'14)
- Parent is not a required field.
No impact on a security and access.
- No impact on deletion.
- Can be multiple layers deep.
- Lookup field is not required.
What is “Master-Detail Relationship”?
Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records.
- Up to 2 allowed to object.
- Parent field on child is required.
- Access to parent determines access to children.
- Deleting parent automatically deletes child.
- A child of one master detail relationship cannot be the parent of another.
- Lookup field on page layout is required.
- Max number of Roll-up Summary fields per an object: 25 (Click here for the Reference)
How can I create Many – to – Many relationship?
Lookup and Master detail relationships are one to many relationships. We can create many – to – Many relationship by using junction object. Junction object is a custom object with two master detail relationships.
A custom object contains some records, now my requirement is to create field in this object with master detail relationship. Can we create master detail relationship in this case?
No, directly we cannot create master details relationship if custom object contains existing records.
Following are the steps to create to create master-detail relationship when records are available in custom object.
- First create field with lookup relationship.
- And then associate look field with parent record for every record
3. Next change the data type of the field from look up to Master detail.
hi,
ReplyDeletein junction object two parent.i.e. A and B and one child i.e. C. if we delete parent A then Child i.e C Will Be Deleted but what happens with B.Is still Exist or deleted?
If we deler=te parent B then also Child C will be deleted.
ReplyDeleteIf we delete parent B then also Child C will be deleted.
ReplyDelete