Hi @Benr,
Great question, and thanks for asking it!
This approach will only work in Specify 7 (not 6), so when managing your Accession data, you will need to use that platform.
In your “Field Formatters” (UIFormatters) app resource for the collection/discipline, you can configure a format like the one you’ve described here:
<format system="false" name="PostfixAccessionNumber" class="edu.ku.brc.specify.datamodel.Accession" fieldname="accessionNumber">
<field type="constant" size="4" value="ACC/"/>
<field type="numeric" size="5" inc="true"/>
<field type="regex" size="0" value="( [A-Za-z])?"/>
</format>
After this is set, you should see ACC/#####( [A-Za-z])? shown in the preview for the field. Now you can enter ACC/10001 A and it will be valid! It will also increment based on your postfix.
![]()
To make this look much nicer and be easier for the user, you can update the Accession view definition so that it uses the appropriate default (add default="ACC/#####" to the field):
<cell type="label" labelfor="1"/>
<cell type="field" id="1" name="accessionNumber" uitype="formattedtext" default="ACC/#####"/>
That’s better! ![]()
Now you can create Accession records with an Accession Number that may or may not have a postfix. It also supports incrementing based on the postfix!
Video Demonstration:
