[SalesForce] Master-Detail Relationship on Custom Object from Managed Package

Is it possible to add Master-Detail Relationship on Managed Custom Object? currently I am getting below error

enter image description here

Best Answer

You can, however create a trigger on a custom object from a managed package. Thus you can essentially fake a m/d

Given a custom object of bar__c in the managed Package namespace foo__ you would create a trigger on

trigger foo__bar__c (after insert, after update, before delete) {
//trigger logic here. Trigger.new will contain the managed custom objects that
// caused the trigger to fire.
}

A trigger that is fired after insert, after update and before delete has the ability to establish or delete any needed relationships with other objects.

You'll just need to find or create the related records, and populate a lookup field on them.

Related Topic