I have created an account "XYZ" and contact for this account(XYZ) as "ABC". Then I deleted the account then its contact got deleted, though account and contacts has lookup relationship still its child is getting deleted, which should not happen. Can anyone please tell me what is going on in the background, why is contact getting deleted? Please let me know if I am missing any important concept for these objects.

Thanks in Advance


Contacts, Opportunities, and other master-detail relationships are deleted when the account is deleted, following the rules listed here. https://help.salesforce.com/HTViewHelpDoc?id=account_del.htm&language=en_US

  • 1
    Contacts and Opportunities have master-detail relationships with Account EVEN THOUGH the AccountId field definition says that they have a lookup relationship - it's just one of those gotchas that you find out through experience – user735 Feb 3 '15 at 17:07
  • even more confusingly, Oppos can be added w/o AccountId (though not through the standard page layout) so in that circumstance, they act like children of a lookup relationship – cropredy Feb 3 '15 at 21:06
  • The above attached link does not gives clarity. It says what happens if you delete an account, I want the reason why does it happens when there is lookup relationship. Why this unexpected behaviour? If you have any related answer to my question please comment. – Praveen Biyani Feb 4 '15 at 5:00
  • 1
    Perhaps we are misunderstanding your question? The linked document explains that the native functionality of Salesforce deletes Contacts, Opportunities, Contracts, Activities, Notes, Attachments, Portal roles and groups, Partner relationships, and Relationship Group Members upon deletion of the Account. Does it matter 'why' if that is the reality of the application functionality? More importantly, are you trying to PREVENT this from happening? If so, that may be a better discussion? – HomerJ Feb 4 '15 at 15:19
  • "Does it matter 'why'??". Yes! it matter because we want to learn the basics clearly. No hard feelings, but yeah I want want to know the reason. – Praveen Biyani May 26 '15 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.