Accession Autonumbering: Add collection code?

I got a question from an end user responsible for registering accessions for many years. We use the “YYYY-AA-nnn” format and the middle letters are used for the collection code abbreviation. She wanted to know whether it’s possible to have the collection code set automatically, e.g. “EN” or “AV”.

image

I have been looking at the visual editor, but it did not offer me any obvious routes for making this so:

Hi Fedoras,

I believe that you should be able to configure the field format for the accession number on a per collection basis using app resources. In the configuration below, I have swapped AA for EN in the alphanumberic line.

<format system="true" name="AccessionNumber" class="edu.ku.brc.specify.datamodel.Accession" fieldname="accessionNumber" default="true">
  <autonumber>edu.ku.brc.specify.dbsupport.AccessionAutoNumberAlphaNum</autonumber>
    <field type="year" size="4" value="YEAR" byyear="true"/>
    <field type="separator" size="1" value="-"/>
    <field type="alphanumeric" size="2" value="EN"/>
    <field type="separator" size="1" value="-"/>
    <field type="numeric" size="3" inc="true"/>
  </format>

Then in the other collection, just modify so that AA is AV etc. The scoping is the same as for form definitions (you can do it by discipline, collection, user)

1 Like