function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
James L.James L. 

Help to confirm uniqueness of Object among production org and sanbox org

Hi,

 

I read about this uniqueness before, just want to double check again.

If I create a new role or profile in developer sandbox, and later one deplay this new role or profile to production org. The ID will keep the same, right ?

 

James

Starz26Starz26

I believe the IDs are only the same froma full sandbox to production.

 

Either way, best practice is to NOT hard code any ids

James L.James L.
Thanks. Hard-coding is not a good idea; but part of my code logic depends on current user's Role and profile. I figure I need to define constants to refer to these Roles/profiles. I have 2 options, either use name (role name, or profile) or ID(role id, profile id). I guess ID will be a better option. There seems some confusion here about the uniqueness. I did see "uniqueness only among full sandbox and production org"; also I see https://help.salesforce.com/apex/HTViewSolution?id=000004579&language=en_US, which says the uniqueness happens among production org and all it's sandbox. Any person from SFDC to clarify this ? James
James L.James L.

Let's say 

If I created new profile/role in production org, will their ID keep the same in developer Sanbox ?

If I created new profile/role in developer Sanbox, will their ID keep the same in produciton Org after deployment ?

 

James