Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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

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.

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

Your Answer

 
discard

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.