Add Agent Identifiers to the form

Before beginning, please review our documentation on editing forms.

Starting with Specify Schema 2.10, you can add Agent Identifiers to the Agent form!

You can see all of the fields available in this table on the schema release notes.

Add to the Form Definition

To add Agent Identifier to your form definition, you can simply open your form definition in App Resources and then check “Show All Tables”.

Once selected, you can choose Agent Identifier from the list of tables. Next click on the Create button.

This dialog will appear allowing you to choose from the default view definition for Agent Identifier (AgentIdentifiers):

You can select this item and add it to your form definition. Now you can make your modifications and click Save to commit it to the database!

If you seek inspiration to make the most of this table, refer to this topic:

Specify 6 XML-based instructions

View components:

        <view name="AgentIdentifiers"
              class="edu.ku.brc.specify.datamodel.AgentIdentifier"
        >
            <desc><![CDATA[Subform within the agent form.]]></desc>
            <altviews>
                <altview name="AgentIdentifiers Table View" viewdef="AgentIdentifiers Table" mode="view"/>
                <altview name="AgentIdentifiers Table Edit" viewdef="AgentIdentifiers Table" mode="edit"/>
                <altview name="AgentIdentifiers View" viewdef="AgentIdentifiers" mode="view"/>
                <altview name="AgentIdentifiers Edit" viewdef="AgentIdentifiers" mode="edit" default="true"/>
            </altviews>
        </view>

View Definition components:

        <viewdef
                type="formtable"
                name="AgentIdentifiers Table"
                class="edu.ku.brc.specify.datamodel.AgentIdentifier"
                gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
                settable="edu.ku.brc.af.ui.forms.DataSetterForObj">

            <desc><![CDATA[AgentIdentifiers subform table for Agent form.]]></desc>
            <definition>AgentIdentifiers</definition>
        </viewdef>
        
        <viewdef
                type="form"
                name="AgentIdentifiers"
                class="edu.ku.brc.specify.datamodel.AgentIdentifier"
                gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
                settable="edu.ku.brc.af.ui.forms.DataSetterForObj"
                useresourcelabels="true">
            <desc><![CDATA[subform on the Agent form.]]></desc>
            <enableRules/>

            <columnDef>100px,2px,473px,5px,120px,2px,125px,0px,15px,p:g</columnDef>
            <columnDef os="lnx">115px,2px,510px,5px,120px,2px,198px,0px,15px,p:g</columnDef>
            <columnDef os="mac">130px,2px,530px,5px,105px,2px,218px,0px,15px,p:g</columnDef>
            <columnDef os="exp">p,2px,473px,5px:g,p,2px,125px,0px,15px,p:g</columnDef>
            <rowDef auto="true" cell="p" sep="2dlu"/>

            <rows>
                <row>
                    <cell type="label" labelfor="1"/>
                    <cell type="field" id="1" name="identifier" uitype="text"/>
                    <cell type="label" labelfor="2"/>
                    <cell type="field" id="2" name="identifierType" uitype="text"/>
                </row>
                <row>
                    <cell type="label" labelfor="7"/>
                    <cell type="field" id="7" name="remarks" uitype="textareabrief" rows="2" colspan="6"/>
                </row>
                <!--<row>
                    <cell type="label" labelfor="9"/>
                    <cell type="field" id="9" name="createdByAgent" uitype="label" readonly="true" uifieldformatter="Agent"/>
                    <cell type="label" labelfor="10"/>
                    <cell type="field" id="10" name="modifiedByAgent" uitype="label" readonly="true" uifieldformatter="Agent"/>
                </row>
                <row>
                    <cell type="label" labelfor="11"/>
                    <cell type="field" id="11" name="timestampModified" uitype="label" readonly="true"/>
                    <cell type="label" labelfor="12"/>
                    <cell type="field" id="12" name="timestampCreated" uitype="label" readonly="true"/>
                </row>-->
            </rows>
        </viewdef>   

Add to the Agent Form

Once you have the view definition defined above, you can add the following XML to your Agent view definition:

 <row>
      <cell type="subview" id="agentIdentifiers" viewname="AgentIdentifiers" name="identifiers" colspan="18"/>
</row>
2 Likes

This was very helpful, thanks!