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
Venkateswarlu PVenkateswarlu P 

can we create Master detail relationship between User and Custom object on Existing Records

User Object has Records and Custom Object[Emp] has no records in it. User object has records in it, so we can't create a master detail relation.Created lookup relation, Then try to convert look up to master by clicking on change field type there is no master detail option to select.
emp Object has below fields.
User-added image
Best Answer chosen by Venkateswarlu P
Jainam ContractorJainam Contractor
Hi Venkat,

You can definitely create a master- detail relation between user and custom object (Emp). In this relationship, User has to be Master and Custom Object needs to be the detail Object. So for that, you need to create a new relationship field of type Master-Detail on the Custom Object. It is not possible the other way round.

Please let me know if it solves your purpose or you need more assistance.

Thanks,
Jainam Contractor,
Salesforce Consultant,
Varasi LLC

All Answers

Jainam ContractorJainam Contractor
Hi Venkat,

You can definitely create a master- detail relation between user and custom object (Emp). In this relationship, User has to be Master and Custom Object needs to be the detail Object. So for that, you need to create a new relationship field of type Master-Detail on the Custom Object. It is not possible the other way round.

Please let me know if it solves your purpose or you need more assistance.

Thanks,
Jainam Contractor,
Salesforce Consultant,
Varasi LLC
This was selected as the best answer
Sagar PatilSagar Patil
Hi Venkateswarlu,

As per Salesforce documentation, a user cannot create a master-detail relationship in which the User or Lead objects are the master. This is a limitation.

Refer link:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/relationships_among_objects.htm

Kindly mark this answer as best answer if it solves your issue.

Regards,
Sagar
Ankit Kumar 169Ankit Kumar 169
Hi Venkat,

We can define master-detail relationships between custom objects or between a custom object and a standard object. However, the standard object cannot be on the detail side of a relationship with a custom object. In addition, you cannot create a master-detail relationship in which the User or Lead objects are the master.

i.e : If you find suitable then  Please close the thread by selecting the best answer :)
Venkateswarlu PVenkateswarlu P
Hi Jainam Contractor,
Can you please send me the steps or process. 
Thanks
Peter Minetree 9Peter Minetree 9

Jainam, remove your answer.  You are thoroughly incorrect.