Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I have a custom object, Division, that has two fields: name and address.

Say I want to make 2 custom fields in User (standard object):

field 1 is the User's Division: a picklist, populated by the names of all unique existing Divisions.

Field 2 is the User's Address: a text field, autofilled from the corresponding Division address (e.g. if User A is in Division B, then User_A.Address = Division_B.Address).

Is there a way to relate a standard object to a custom object in this manner?

share|improve this question
up vote 2 down vote accepted

You cannot create Lookups on User - thus you cannot have a relationship between User and Division. You still have a couple options depending on how scalable you need this solution to be.

  1. User.Address (field 2) should be a Formula (text). This field will use CASE() to determine the Address based on User.Division (Field 1). This solution is the easiest to implement, but it is not ideal because any changes to Divisions will need to be made to both the Division records and the User.Division formula.
  2. Trigger on User object. This trigger can query Division records to find a Divison where Division.Name == User.Division. Then populate, User.Address with Division.Address. This solution is more dynamic and maintainable, but it will be a lot more work to implement.
share|improve this answer
I went with the Trigger method, which ended up working perfectly. Thanks for the help! – gfppaste Jan 24 '13 at 19:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.