James Gu
James Gu

Reputation: 1392

Salesforce Master-Detail Relationship

I have two objects: House and Owner

Owner has a field "ID", House has a field "Owner_ID", how do I link "Owner_ID" to the "ID" field in Owner using a Master-Detail relationship in the Salesforce under schema builder?

When I create a new M-D relationship in House, It doesn't have a selection box to let me set which field does a M-D relationship refer to in Owner. It defaulted to the "Owner Name" field. (ie. when I insert a new House, I can search for the owner by "Owner Name", but cannot search for the owner by "ID")

Upvotes: 2

Views: 4659

Answers (2)

Mingyu
Mingyu

Reputation: 33379

Starting from Summer'12, it is possible to change the parent record of a child record:

How to reparent:

To enable this option, select the Allow reparenting option in the master-detail relationship field definition.

Reference:

https://developer.salesforce.com/releases/release/Summer12/master+detail+relationship+expands

Upvotes: 0

Matt Lacey
Matt Lacey

Reputation: 8255

Master Detail relationships only link to the ID field of the parent record — you can't change this. That said, the UI uses the names for the convenience of users which is why you're not able to search via ID there.

Upvotes: 2

Related Questions