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
Kamran-RaoKamran-Rao 

System Generated ID of a Deleted Record of Custom Object Reassigned to a New Record

We are in a very complicated situation. We have a custom object 'xyz' linked with the contracts. When user deletes some record with ID (e.g., system generated SF ID is 'a1ZR00000008ko6') and then creates a new record in xyz custom object associated with the same contract. SF system assigns the same ID (ID of the previously deleted record) to the newly created record on non-deterministic or intermittent basis. But whenever this scenario happens it creates a lot of mess with hours of backtracking for us. Does someone has an idea on what algorithm basis SF generates unique ID’s, is there any possibility of their duplication? 

Has this problem ever happened to somebody or any such know issue is there? Is this really possible? any comments that can help us.

 

Regards,

Rao
Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
As far as i know, that's not possible. However it is possible that the original record after been deleted was undeleted, in which case the undeleted record would retain its original id.

All Answers

SuperfellSuperfell
As far as i know, that's not possible. However it is possible that the original record after been deleted was undeleted, in which case the undeleted record would retain its original id.
This was selected as the best answer
Kamran-RaoKamran-Rao

Thank you very much Mr. Simon for this important tip off. Can you please further bit explain the undelete process since I do not know how can we undelete where should I find an option to undelete?

 

I appriciate your support. 

 

Thanks & Regards,
Rao

Kamran-RaoKamran-Rao

Just to add, are you referring undelete from Recycle Bin or to some other mechanism?

 

Thanks, 

Rao

SuperfellSuperfell
From the recycle bin.
Kamran-RaoKamran-Rao

Simon,

 

This is great. We were having problems exactly by the same scenario.

 

Thanks
Rao

Mike @ G2Mike @ G2

Hi Simon,

 

Not quite the same question as the above user but related, how do i assign system generated Case numbers that do not only include number? for example i currently have cases that get assigned a case number automatically in a {0000000} format, is there a way to assign wither random numbers, or random letters or prefferable a combination of the both?

 

thanks.

 

Mike