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?

  • 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 Jun 6 '13 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. – Nisse Knudsen Jun 6 '13 at 10:04
  • 1
    If you use SAML for single sign on the FederatedIdentifier field would work wonders for this purpose. – drakored Jun 6 '13 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. – techtrekker Jun 6 '13 at 12:26
  • 7
    Some of these comments could/should be answers :) – Steven Herod Jun 6 '13 at 13:21
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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