I am attempting to migrate a Custom Object using Salesforce, and all is well except the Starting Number for a formatted AutoNumber field is not pulled.

I have read through the MetaData Guide (below) and cannot find an example of how to implement this into my package.xml file.


Regarding the note that startingNumber cannot be retrieved, I have tried to put this into the deploy package.xml file.

Thanks for the help.

1 Answer 1


See this note:

  • You can’t retrieve the starting number of an auto-number field through Metadata API. To specify a Starting Number while deploying, add a startingNumber tag for your field to your package.xml file. For example: 42
  • If you deploy without specifying a Starting Number value in your package.xml file, the default starting number for standard fields is 0. The default starting number for custom fields is 1.

Here's a sample where I was able to set it by just manually injecting it into the retrieve metadata:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Starting Number test</label>

You may need a post retrieval script to accomplish the same if you want to automate this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.