7

Normally users across production and sandboxes have the same unique user ID, given that you created the production user first, and then refreshed the sandbox. We have the case that we created users first on sandbox, and afterwards created them in production (idea: first play/train in sandbox, then get productive in production environment). Therefore a user has in production a different user ID than in the sandbox.

Is there any way to make them "equal", without having to refresh the sandbox?

5
  • 3
    No, the only way is by refreshing. What are you doing that requires the Id to be the same? Best practices are to not tie anything to a hard coded Id.
    – drakored
    Commented Jun 6, 2013 at 10:02
  • Thanks, I expected that answer... :( I am not hardcoding the ID, it is for an external support tool, where we connect customer users to our CRM contacts. The ideal case is to have (independent of any org derivate (e.g., production, sandbox)) for each user one contact and one portal user. Commented Jun 6, 2013 at 10:04
  • 1
    If you use SAML for single sign on the FederatedIdentifier field would work wonders for this purpose.
    – drakored
    Commented Jun 6, 2013 at 10:11
  • 3
    You can create a new External Id field on User, and stamp that with the Id from Production. You can then use this External Id field for any mapping with your tool. Commented Jun 6, 2013 at 12:26
  • 7
    Some of these comments could/should be answers :) Commented Jun 6, 2013 at 13:21

1 Answer 1

5

Nope. You could add an external Id on the user record and then upsert if you're trying to load records. Or perhaps add a custom setting to store their Ids access multiple environments if you need to access that data through Apex.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .