You need to sign in to do that
Don't have an account?

Delete Trigger with a Master Lookup relationship question.
I have a custom object (Portal_User__C) with a field called user_name__c. The user_name__c field has a master lookup relationship to the contact record. I have a before delete trigger on the Portal_User__c record that sends an email to the portal administrator. It works fine if I just delete the portal_user__c record. However; if I delete the contact record first, by design it does delete the portal_user__c record but the trigger does not work. Do I have to write two triggers? (One for the contact record to check for portal_user__c records before it can be deleted. And a second one for the actual Portal_user__c.) Or how does that work?
Here's another thread on a related topic on stack exchange: http://salesforce.stackexchange.com/questions/23198/delete-triggers-dont-cascade-master-to-detail-so-why-not-hand-cascade-on-the-m