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

Is there any relationship between Profile Ids across Sandboxes and production? Found somewhat similar post here. I have noticed that the id is equal for System Administrator profile and I am using it in my Constants class for some profile based validation and still working fine.

But recently noticed that this is not true for custom profiles. Is it?
Is so what is the recommended way to do profile based validation (I believe it's good go with Ids since Names can be changed in future).

share|improve this question

It depends on how you create your profiles between sandbox and production.

If you create your profile manually in sandbox and manually in production, the id's wont be the same for sure.

Now if you deploy your profile from Sandbox to Production, the id's will be the same only from a FULL Sandbox.

If you refresh your sandbox, the id's will be the same.

share|improve this answer
after a refresh is it get changed the Id? I mean if it's equal earlier and when the refresh happens is it changing the Id?(even though it's equal across sandboxes/ production) – highfive Apr 23 '14 at 5:54
If you refresh your sandbox, it will always get the id of production for every kind sandbox. If it's already equal before the refresh, obviously your id doesn't change, it's the one from prod. – brovasi Apr 23 '14 at 6:07
Yah got it. Sorry for dumb question :) but wanted to get it resolved. Any idea about the better way to handle profile based validations other than having custom id? – highfive Apr 23 '14 at 6:11

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.