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
HarryHHHarryHH 

How to link a user to a Location

Hallo,

 

I am designing a force.com application with different locations. In these locations are different warehouses. Each user of the platform should only work with the items in the warehouse of the specific location. So the user should have a lookup-relationship to the location. But if I try to generate a customer field for the user a lookup-relationship is not possible. What can I do, to link the user to the location?

 

Thanks!

Harry

Best Answer chosen by Admin (Salesforce Developers) 
sh-at-youseesh-at-yousee

Hi,

 

You're right, you cannot create a lookup relation from the User objec. Or, you can, but only by using Hierarchical Relationship which then points to another User.

 

Maybe you could add a custom field called Location, make it mandatory ensuring it's being populated when new users are created.

 

That custom field could then act as a reference for which location the user belongs to.

 

Hope that helps.

 

/Søren Nødskov Hansen

All Answers

sh-at-youseesh-at-yousee

Hi,

 

You're right, you cannot create a lookup relation from the User objec. Or, you can, but only by using Hierarchical Relationship which then points to another User.

 

Maybe you could add a custom field called Location, make it mandatory ensuring it's being populated when new users are created.

 

That custom field could then act as a reference for which location the user belongs to.

 

Hope that helps.

 

/Søren Nødskov Hansen

This was selected as the best answer
HarryHHHarryHH

Hi Soren,

 

Thanks for your help. I hoped there would be a more elegant solution for this issue. Obviously there no one woh knows a better solution. Next week I'm going to the DEV501 Trainig and I will ask the trainer, if he knows a better way. Are you interested if there is any? 

 

Thanks Harry

sh-at-youseesh-at-yousee

Hi Harry,

 

Sure, please do post an update if the trainer has a better way.

 

/Søren Nødskov Hansen