Automatically create a new Preparation, Determination, or Collection Object Attribute upon CO creation

Why to autogenerate a Preparation, Determination, or Collection Object Attribute upon creation

This streamlines the data entry process, so that when a user creates a new collection object, one or all of the preparation/determination/attribute records are created automatically, without the user needing to add them.

This reduces the number of clicks for the person creating the record and allows administrators to make fields in related tables mandatory (in the form definition XML or schema) before a new collection object record can be created.

Find Collection ID

First, navigate to the following URL in your instance:

http://example.specifycloud.org/specify/query/new/collection/

Replace example.specifycloud.org with your Specify 7 URL. This will begin building a new query on the Collection table.

In this query, you will want to include both the ID and the Collection Name. To see ID, you will likely need to enable the “Reveal Hidden Form Fields” in the bottom right of the query builder.

Now we can see that this collection has an ID of 4. We can proceed to the App Resources interface and change the new Collection Object record creation behavior.

Change new record behavior

Now that we have the Collection ID, we can add one or more new remote preferences.

After clicking on the Remote Preferences app resource under Global Resources, I added the following three lines:

You can use any combination of the three as they work independently of each other.

Upon the creation of a new Collection Object, each line tells Specify to do the following action:

Create a new Collection Object Attribute record

CO_CREATE_COA_4=true

Create a new Determination record

CO_CREATE_DET_4=true

Create a new Preparation record

CO_CREATE_PREP_4=true

That’s it! Save and clear your cache.

Now when you create a new Collection Object, your desired record will be created automatically.