1

I have the following objects Training_Group_Criteria__c and Training_Group_Rule__c. I am trying to create a master-detail field to make Training_Group_Rule__c a detail of Training_Group_Criteria__c. But when I come to the drop down of objects which can be a master I do not find Training_Group_Criteria__c. What may I try and why is that even possible?

Thank you.

enter image description here enter image description here

  • Do you have any data in Training_Group_Rule__c? – Jayant Das Dec 4 '18 at 17:06
  • @JayantDas, what do you mean by data in object? – oobarbazanoo Dec 4 '18 at 17:07
  • Take a look at this link, if that's your case. – Jayant Das Dec 4 '18 at 17:07
  • @JayantDas, ok let me delete all the records which are of type to which I want to add a master-detail relationship and get back to you. – oobarbazanoo Dec 4 '18 at 17:08
  • Do you already have a lookup relationship to that object and you are trying to change it to M-D? – Jayant Das Dec 4 '18 at 17:09
2

If you already have a lookup relationship to an object, and that you don't have values populated on that field for records, then you cannot change the field to be a Master-Detail relationship.

Refer to the help documentation

You can convert a lookup relationship to a master-detail relationship, but only if the lookup field in all records contains a value.

and this knowledge article for details.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.