Ask Search:
S GARGS GARG 

I have lookup relationship between 2 objects.if i delete the parent record i don't want to delete the child record also .how can i do this??In my case Assigment is parent object and and time card is child object.

Best Answer chosen by S GARG
Amnon KruviAmnon Kruvi
If it's a field coming from a managed package, I'm afraid you're out of luck. You'll have to speak to the vendor of the package. 

All Answers

Amnon KruviAmnon Kruvi
What you want is the default behaviour for lookup fields. Child records are only deleted if you have a master-detail relationship, or if you contacted support to enable cascade delete for lookups - - or of course if you have a custom trigger deleting child records. 
Ankush AgarwalAnkush Agarwal
Hi,

In Lookup Relationship, if Parent record is deleted child record never get deleted. Instead to achieve this, we have to write the Apex Trigger on Parent object to delete child record if Parent record is deleted.

Whatever you asked is the default functionality of lookup relationship. You need not make any changes.

If you want opposite child record also need to be deleted then let me know I will share the Apex Trigger to do so.

 
S GARGS GARG
But when i am deleting Assignment record,it  is showing error :that please delete associated timecard before deleting Assignment.
S GARGS GARG
User-added image
Ankush AgarwalAnkush Agarwal
As per screen-shot, there is validation rule which is validating the relation for this lookup and stoping user to delete the record. Could you please validate Validation Rules on Assignment and Timerecord object.
Amnon KruviAmnon Kruvi
It isn't a validation rule. Go to the timecard object and check the lookup field - there is an option there to not allow to delete parent records. 
S GARGS GARG

Since i cant locate an edit  option in lookup field as it is part of managed package.So limited scope of editing.

Amnon KruviAmnon Kruvi
If it's a field coming from a managed package, I'm afraid you're out of luck. You'll have to speak to the vendor of the package. 
This was selected as the best answer
S GARGS GARG
Ok Thanks,for the knowledge.