This will work for any entity – custom or out-of-the-box. All that is involved is 1) creating an auto number entity and record, 2) creating a relationship with the entity you would like to have an auto number in, and 3) making a real-time workflow populate and increment the number.
Here are the steps to go through. You will end up with an automatically-generated number with an optional prefix and suffix on the first save of the record. I added the ability to increment your auto number by any whole number in the event that you have that requirement.
1. Create & save your solution:
![image1](http://www.encorebusiness.com/wp-content/uploads/2016/08/image1.png)
2. Add the entities you would like to add the auto number functionality to.
In this case I am going to create the ability to auto number Accounts, Quotes, and a custom entity I created called Projects.
![image2](http://www.encorebusiness.com/wp-content/uploads/2016/08/image2.png)
3. Create a new entity called AutoNumber.
![image3](http://www.encorebusiness.com/wp-content/uploads/2016/08/image3.png)
4. Add the following fields to the AutoNumber form for each entity you would like to have auto numbering.
- Prefix (Text)
- Suffix (Text)
- Number (Whole Number, Simple)
- Increment (Whole Number, Simple)
![image4](http://www.encorebusiness.com/wp-content/uploads/2016/08/image4.png)
5. Create a 1:N relationship between your AutoNumber entity and the entity(ies) you would like to have the auto number functionality apply to.
![image5](http://www.encorebusiness.com/wp-content/uploads/2016/08/image5.png)
6. Create your AutoNumber form:
Create a section for each entity you would like to auto number.
![image6](http://www.encorebusiness.com/wp-content/uploads/2016/08/image6.png)
7. Add a text field to each of the entities you would like to auto number.
This will store the generated number. In this case I have called mine Account Number.
![image7](http://www.encorebusiness.com/wp-content/uploads/2016/08/image7.png)
8. Create the AutoNumber record with the default values in it.
- Go to advanced find
- In “look for” select AutoNumbers
- Click results
- Click New AutoNumber
- Enter in your values
![image8](http://www.encorebusiness.com/wp-content/uploads/2016/08/image8.png)
9. Now create the workflow to set and update the AutoNumber (one for each entity).
![image9](http://www.encorebusiness.com/wp-content/uploads/2016/08/image9.png)
10. Create a step to update the quote and set the Quote AutoNumber lookup to the value of the record you created (Defaults).
![image10](http://www.encorebusiness.com/wp-content/uploads/2016/08/image10.png)
11. Update the value to your quote number field on the quote form using the AutoNumber values:
![image11](http://www.encorebusiness.com/wp-content/uploads/2016/08/image11.png)
12. Increment the Quote AutoNumber number field by the amount in the quote increment field
![image12](http://www.encorebusiness.com/wp-content/uploads/2016/08/image12.png)
13. Leaving you with a Workflow looking like this Repeat it for each entity you would like to Auto number.
![image13](http://www.encorebusiness.com/wp-content/uploads/2016/08/image13.png)
Now create some records and you should have some automatically generated numbers!