- September 29, 2018 at 9:26 am #40828
Create field in custom object containing some records with the master-detail relationship
A custom object contains some records, now my requirement is to create the field in this object with the master-detail relationship. Can we create master-detail relationship in this case?September 29, 2018 at 9:26 am #40829shariq #1
No, directly we cannot create master-detail relationship if custom object contains existing records.
Following are the steps to create master-detail relationship when records are available in custom object.
First create field with lookup relationship.
And then associate look field with parent record for every record.
Next change the data type of the field from look up to Master detail.September 29, 2018 at 6:44 pm #41029Aman #4
Read these steps:
To create the master-detail relationship field to relate custom object with the account objectFrom Setup, enter Objects in the Quick Find box, then select custom object
In the Custom Fields & Relationships related list, click New.
Select Master-Detail Relationship, and click Next.
In the Related To drop-down list, choose account, and click Next.
Click in the Field Name text box and enter the field name —-.
Select the Read/Write radio button.
Check Child records can be reparented to other parent records after they are created if you want to be able to change the relationship field’s value. If you leave this box unchecked, you can’t change the value in the future.
Accept the defaults in the remaining three steps of the wizard.
ThanksSeptember 29, 2018 at 9:26 pm #41145Avnish Yadav #3
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.
Maximum number of Master-Detail relationships on a Custom Object is: 2
Maximum number of Lookup relationships on a Custom Object is: 25
Maximum number of Lookup relationships on a Standard Object is: 25
Thanks.September 30, 2018 at 8:00 pm #41860
Please Register to reply to this topic. /