Restore Auto-Number on Managed Object

auto-number

  • In our managed package, we have a custom object where the Name field is an auto number
  • We're using a flow to create records of that custom object
  • In our trial source org, somebody tested that flow and it failed (error irrelevant)
  • No record was inserted into the database, but Salesforce increased the auto number
  • We now have e.g. REC-0001, REC-0002 and REC-0003 in that trial source org
  • The next record however will be REC-0005 since the auto number was increased
  • Since REC-0004 was never created, it also does not exist in the recycle bin

Is there any way we could get REC-0004 back?

Best Answer

As per Salesforce help article, the only option seems to be to remove and install the package.

This (updating type to text and back) does not work for Objects installed by managed released packages (because the components below are locked). If you want to restart Auto-Number fields on Objects from a managed released package, you can uninstall the package and reinstall it.

Related Topic