function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SV MSV M 

Why Account and Contact objects have Master Detail relationship

Why Account and Contact objects internally have Master-Detail relation even though they were in Lookup relation. Can anyone explain why?
Best Answer chosen by SV M
AKASH DEEPAKASH DEEP
Hello Sai,
Contact and Account don't have a Master-Detail Relationship, Contacts and Accounts have a lookup relationship but this relationship has a property called CascadeDelete set to true. This is why the contact is deleted when the parent object is deleted. 


Contact.AccountId :-
  • Cascade Delete : True
  • ChildSobject : Contact
  • DeprecatedAndHidden : False
  • Field : AccountId
  • RelationshipName : Contacts   

Hope this will help you,
Best Regards,
Akash Deep

All Answers

Maulik D ShahMaulik D Shah

Hello Sai Vineeth Maddula,

Refer to this link.
https://salesforce.stackexchange.com/questions/28624/relationship-between-account-and-contact

I hope this helps you.

AKASH DEEPAKASH DEEP
Hello Sai,
Contact and Account don't have a Master-Detail Relationship, Contacts and Accounts have a lookup relationship but this relationship has a property called CascadeDelete set to true. This is why the contact is deleted when the parent object is deleted. 


Contact.AccountId :-
  • Cascade Delete : True
  • ChildSobject : Contact
  • DeprecatedAndHidden : False
  • Field : AccountId
  • RelationshipName : Contacts   

Hope this will help you,
Best Regards,
Akash Deep
This was selected as the best answer
SV MSV M

Thanks for the response and I have another doubt regarding the relationships. What is the relation between Account and Opportunity objects? I checked there is a Lookup relationship between them but when I observed there is also Cascade delete rule between them. Can anyone explain this?

AKASH DEEPAKASH DEEP
Hello Sai Vineeth Maddula,

A cascade-delete bypasses security and sharing settings, which means users can delete records when the target lookup record is deleted even if they don't have access to the records. To prevent records from being accidentally deleted, cascade-delete is disabled by default. In Lookup Relationship the cascade delete means when the parent get deleted the child as well gets deleted but in lookup relationship their is no parent security in child object and in standard objects, Salesforce use lookup relatioship with Cascade delete True

Hope this will help you,
Best Regards,
Akash Deep