You need to sign in to do that
Don't have an account?
Chloe Brown
How to set a max of 4 digits for an Auto Number Field so that it starts at 0 should it get tp 9999?
I am trying to assign max value to an auto number field in order to generate a student number that can only be a certain amount of digits. The auto number may only increment until 9999 - meaning it cannot exceed 4 digits. So once it reaches 9999, it must reset and start at 0 again. Is this possible? Any help would be so appreciated! Thank you.
If you are an admin and want it to be done quickly, create a formula field that will take substring of standard autonumber, and perform mod operation with 9999. Doing this will give you desired result.
Assuming you've a pattern -> AB-0001, Formula
If you are developer, you can use same logic using code without requiring auto number. If there are no records assign 0, if previous records exists, get last created record, get its number increment it by 1 and if its more than 9999 mod it to zero, and save the new record
Work of caution : Assigning same number to multiple students may create inconsistencies in Database as your organisation saves more & more data.