function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sornasorna 

OwnerId field of a child record in a master-detail relaitonship

Hi All,

We had a lookup relationship between to object and we were copying the owner of the parent to child when ever a new child record got inserted. But if the owner of the parent is an inactive user then the child record cannot be inserted because we were getting the exception "Insert failed. Operation performed with Inactive User".

 

So, then we changed the lookup in to master-detail and now we are able to create a child record for a parent whose owner is inactive. So, I am curious to know what value would be assigned to that child record. But I could neither query the ownerId field for that child object nor find the ownerid field in eclipse. 

 

Do anyone know what Salesforce does with the ownerid field of a child record in a master-detail relationship? And is there a way to query that field?

 

Thanks,

Sorna

Best Answer chosen by Admin (Salesforce Developers) 
nylonnylon

Hi,

In Master-Detail relationship, the Owner of child record are always the same as its parent's.

 

Overview of Relationships:

https://login.salesforce.com/help/doc/en/overview_of_custom_object_relationships.htm

All Answers

nylonnylon

Hi,

In Master-Detail relationship, the Owner of child record are always the same as its parent's.

 

Overview of Relationships:

https://login.salesforce.com/help/doc/en/overview_of_custom_object_relationships.htm

This was selected as the best answer
sornasorna

Thanks Nylon for the link. It was very helpful.