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).

1 Answer 1


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.

  • 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, 2014 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, 2014 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, 2014 at 6:11

You must log in to answer this question.

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