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
getworkinggetworking 

Does SF ever re-use object key prefix of a previously deleted custom object

Hi all, I want to know if SF will ever reuse the same key prefix on a custom object that has previously been deleted or is it guaranteed to use a new one?

I know, that SF record IDs are globally unique and it will take many million years before SF runs out of them, but what about the object key prefix (or ID) within a single org?

For custom objects, the prefix is 3 characters long, case sensitive and alphanumeric which gives around 240k variations.
Best Answer chosen by getworking
getworkinggetworking
I guess I will answer my own question after a few experiments, in case it will save anyone else some time.

The custom object prefixes (or IDs) are in fact re-used.

The prefix seems to be sequential, so if you create a new custom object that gets prefix a01, the next one will get a02 and so on.

What happens with prefixes of deleted objects?

Well, while the object is not completely erased and is still in the recycle bin, the prefix will remain reserved. So if you delete a01 and create a new object, it will get prefix a03, however, if you erase a01 from the bin before creating a new object, the new object will get now released prefix a01.

Also, the name (and API name) of a custom object has no effect on the prefix that an object gets.

All Answers

getworkinggetworking
I guess I will answer my own question after a few experiments, in case it will save anyone else some time.

The custom object prefixes (or IDs) are in fact re-used.

The prefix seems to be sequential, so if you create a new custom object that gets prefix a01, the next one will get a02 and so on.

What happens with prefixes of deleted objects?

Well, while the object is not completely erased and is still in the recycle bin, the prefix will remain reserved. So if you delete a01 and create a new object, it will get prefix a03, however, if you erase a01 from the bin before creating a new object, the new object will get now released prefix a01.

Also, the name (and API name) of a custom object has no effect on the prefix that an object gets.
This was selected as the best answer
shubham r 9shubham r 9
Hey getworking, it did save my time! Thanks for the share!