Form Customization

I am trying to customize the CollectionObject form by editing botany.views.xml. It was working great. I could save my changes in Notepad++, reopen the form in Specify and see my changes. I imported the file. Now whatever changes I make to the xml the form doesn’t change. I have System > Forms > Reload Views checked. After revert Specify should look to the file in the C:/Program Files/Specify/Config/Botany/Manager folder for the default but when I make changes to the file in that location the form doesn’t change. Even after exiting Specify and logging in again I don’t see any changes.

Hi Setve. If your new customized botany.views.xml has any issue it will not run and you won’t see the form you are modifying. Specify reverts to the next form uploaded or available up the user hierarchy ladder (actually, down the user-user type-collection-discipline… picklist). Thus what’s displayed (unaffected by your changes) is really a different xml form --although perhaps undistinguishable-- from the one you’re working on. There may be other causes, but check that one first by reading the /username/Specify/specify.log file

The Collection Object form has a Collectors subform with Last Name, First Name and Remarks. I would like to add Middle Initial and remove Remarks. There is no xml for these fields in botany.views.xml. In what file can I find them?

Steve

The line for “middleInitial” can likely be found in the viewdef for the Agent subform, within that same botany.views.xml. If your Collectors subform is designed to display firstName, lastName, etc., all parsed out (which would be odd), you can always copy & paste there that line to include a middleInitial cell.

I found it in common.views. How would I change the xml to show the whole name not parsed out?

Steve

I think you need to use the formatter in the schema configuration to change how the name field displays the name as a whole. (e.g., if you want it to display suffix, title, or alter the order of the name components) The Agent subform needs has to have everything parsed out into separate fields but when that agent is referenced elsewhere, (collectors, cataloger, determiner, etc) it should then display the full name however you have it formatted to do so.

The formatter has a format called “Agent” with what I want.

I added a line in the xml to use that format for the Agent (AgentID) field in the collector table.

                 <cell type="label" labelfor="9"/>
                <cell type="field" id="9" name="Agent" uitype="label" colspan="3" readonly="true"  uifieldformatter="Agent"/>

The Agent field shows in the Collectors subform but no text shows in it.

image

I tried to remove the Last Name, First Name, Middle Initial fields but for some reason when I do the whole subform disappears.

I also put default=“today” for the cataloged date but the date isn’t showing on the form.

                <cell type="label" labelfor="5"/>
                <cell type="field" id="5" uitype="plugin" name="this" initialize="name=PartialDateUI;df=catalogedDate;tp=catalogedDatePrecision" uifieldformatter="Date" default="today" colspan="3"/>

Steve

I was able to get today’s date to show by making a new box on the form without the dropdown to choose full or partial dates. Date cataloged will always be a full date. The form won’t let me comment out the original box though.

image

On the Collectors subform I can comment out FirstName but if I comment out LastName or MiddleInitial the subform disappears.

The name of the collector, formatted last name first, is showing now in the collectors subform. The problem was in the xml I had name=“Agent” instead of name=“agent” with a lower case “a” to match the name of the agent table which is lower case.

I want to remove MiddleInitial but when I comment it out the Collection Object form reverts to the default.

Steve