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
dragon123dragon123 

what is the right Answer?

9) What happens when a parent record is deleted in the Parent Child model having a Lookup Relationship between Parent - Child Objects?

 A. Child records are also deleted 
 B. Shows an error 
 C. Cant delete the record 
 D. Child records are not deleted

 

What is the correct answer?

 

If I delete a account Record , correponding contact also deleted. so answer is A.

 

But lot of sites mention Answer is D....

hitesh90hitesh90

Hi,

 

Answer D is right..

 

Account and contact have both relationship lookup and master-detail.

at business logic it has master detail relationship and in UI it has lookup relationship.

 

for example: you can create contact without creating an Account. it shows that it has lookup relationship.

and as you say the other thing If you delete account Record , correponding contact also deleted. this shows master-detail relationship.

 

so it has both relationship but in documentation it is a lookup relationship.

 

Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thanks,
Hitesh Patel

 

dragon123dragon123

Still confusing this scenarios......

 

 

 

For contact object , Account name is lookup. How can u say this act as master- detail?

harsha__charsha__c

Hi, 

 

If the lookup field on Contact (i.e. AccountId field), is a required field then this scenario comes into picture. Though it is look-up relationship, the Account Id is a mandatory field. So, there can't be a Contact with the null value for the mandatory fields.

 

So, the Contact  is also getting deleted.

 

I think this is the reason for the reported use-case.

 

I hope this makes sence.

PFangPFang

Thanks dragon, this is really helpful information!

AshishyadavAshishyadav

yes truely said by Hitesh ,,
By standarad account and contact is master detail relationship ....
but salesforce has provide lookup on the contact so that we can create contact if we want to create without account ...

so bottom line is
if contact has an account it acts like master detail relationship

So if salesforce has given only master detail relationship then it would be compulsarly provide account so it gave lookup with master detail relationship


i hope u understood ..if not let me know

Tejpal KumawatTejpal Kumawat

Hi,

 

Option : D. Child records are not deleted is the right Answer. For more information see below link

https://ap1.salesforce.com/help/doc/en/overview_of_custom_object_relationships.htm

SBA1989SBA1989
Hi, 

Account and contact is having a lookup relationship with cascade delete feature enabled by salesforce. 
It is not M-D. Where as Account and Opportunity is having M-D.