Is it possible to add Master-Detail Relationship on Managed Custom Object? currently I am getting below error
Attribution to: Mehul
Possible Suggestion/Solution #1
You cannot add master-detail relationship to managed custom object.Please vote for this idea .In the idea comments Product Management has suggested work around.please go through it.
Attribution to: sfdc
Possible Suggestion/Solution #2
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.
Attribution to: Kevin P
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33855