Activity Forums Salesforce® Discussions Why we have to delete all records before creating a Master Detail relationship in a Master?

  • Why we have to delete all records before creating a Master Detail relationship in a Master?

    Posted by shariq on July 4, 2017 at 1:31 pm

    In Salesforce, why we have to delete all records before creating a Master Detail relationship in a Master?

    shariq replied 6 years, 3 months ago 3 Members · 5 Replies
  • 5 Replies
  • Sudhir

    Member
    July 5, 2017 at 9:17 am

    You create a relationship field on the child object.

    Can you explain clearly what you are asking - deleting all records of which object ?

  • shariq

    Member
    July 5, 2017 at 10:33 am

    hello sudhir,
    Either u delete all records on that child object or u first create a lookup then change it to master detail. My question is that, why u cant create master detail on that child object with existing records.

  • Sudhir

    Member
    July 5, 2017 at 10:47 am

    Simply because the master-detail relationship mandates that for a child to exist, the master must exist.

    All the existing child record must be first associated with their parent in order to convert lookup to master-detail.

  • Parul

    Member
    September 15, 2018 at 7:27 pm

    Hi

    If you want to create master detail on that child object with existing records then first you need to create to convert lookup to master-detail.

     

     

    Thanks

  • shariq

    Member
    September 16, 2018 at 10:39 am

    Hi,

    Main reason what I found is  -

    Master Detail is required field, that's why on existing record it will be empty which is not allowed by salesforce so either delete those or create lookup and change it into master detail after filling the fields in existing records.

    Thanks.

Log In to reply.

Popular Salesforce Blogs