Activity Forums Salesforce® Discussions Not able to create a Master Detail field in Salesforce. Need assistance.

  • Naman

    Member
    April 18, 2016 at 12:10 pm

    Make sure that both of the objects having no records before creating master detail.

  • PRANAV

    Member
    February 12, 2018 at 8:39 am

    Hi,

    Salesforce will not accommodate a master detail relationship to a custom object that already contains data.

    This is because creating a master detail relationship adds a new required field to the custom object (known as a "foreign key" to database administrators). Each data record in the object needs to have a valid value in the field -- it cannot be left blank.

    • If the object ( detail ), that you want to relate to, does not yet have many records, a possible workaround is to delete the data in your custom object, and then add the master-detail relationship.
    • If you don't want to lose all of your existing data, another approach is as follows:
      1. Create a Lookup relationship instead of a Master-Detail relationship. This adds the new "foreign key" field to the custom object, but it is not required to have a value for each data record. Do NOT make the Lookup "required".
      2. Add a valid value in the lookup (foreign key) field of each data record in the custom detail object. (You may need to create a custom tab to facilitate this data entry.)
      3. Edit the object relationship and change the relationship type from Lookup to Master-Detail.

    Hope this helps you more.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos