• #29489
    Salesforce | Sanjana Sanjana #323

    Can we create Master-Detail relationship on existing records in Salesforce?

    Can we create Master-Detail relationship on existing records in Salesforce?



    Hi Sanjana,

    You cannot create a new Master-Detail relationship on an existing custom object if records already exist. You must first create a Lookup relationship, populate the lookup field with data in all records, and then change the relationship type to Master-Detail.

    Salesforce | Parul Parul #2


    Converting Relationships

    You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.You can convert a lookup relationship to a master-detail relationship, but only if the lookup field in all records contains a value.

    Self Relationships

    You can create a relationship from an object to itself, but it must be a lookup relationship, and a single record can’t be linked to itself. However, a record can indirectly relate to itself. For example, the Holiday Promotion campaign can have the Direct Mail campaign selected in the lookup relationship, and the Direct Mail campaign can have the Holiday Promotion campaign selected in the lookup relationship.You can’t create a many-to-many self relationship, that is, the two master-detail relationships on the junction object can’t have the same master object



    Salesforce | shariq shariq #1


    You need to create a lookup field then fill this field with some parent value, then convert its type to master detail.

    Hope this helps.



    You need to create the lookup, then populate each one so that each child record has a parent record. This is because a master-detail relationship does not allow for ‘orphaned’ child records. Once you have a lookup with each child having a parent, then you can go back and convert the lookup field to a master-detail.



Viewing 5 posts - 1 through 5 (of 5 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?