Automatically create a new Collector upon CE creation

The title purposefully mimics Automatically create a new Preparation, Determination, or Collection Object Attribute upon CO creation and says it all.

The Embedded Collecting Event option and the three remote preferences CO_CREATE_COA, CO_CREATE_DET & CO_CREATE_PREP proved very useful for easing up and securing new CO entry. Number of clicks is decreased and mandatory fields are clearly identified.

A Collecting Event does not make sense without a Collector in CAY herbarium. When I set up the CO_CREATE preps, my colleagues immediately asked whether a new Collector could be automatically created as well, since it is mandatory in our data entry process.

:point_up: Can one automatically creates a new Collector upon CE creation ?

A quick look at CollectionObject initialization and CollectionObject Resources initialization seems to indicate that presently answer is no and that it may not be straightforward to implement.

:thinking: I’m also wondering why you decided to implement COA, DET & PRE creation through Remote Preferences ? (genuine question) Have you thought of a generalized approach in viewdef resources, with for instance and XML attribute that would control the underlying resource creation ?

<!-- COA subview with 'create' attribute -->
<cell type="subview" viewname="CollectionObjectAttribute" id="10" name="collectionobjectattribute" colspan="14" initialize="" create="onDataEntry"/>
<!-- Collector subview with 'create' attribute -->
<cell type="subview" viewname="Collector" id="12" name="collectors" colspan="12" rows="3" create="onDataEntry" />

The create attribute could accept several values:

  • never (default)
  • onDataEntry : create the underlying object on new data entry only
  • ifEmpty : create the underlying object on new data entry or on data edition if empty
  • ?

Feel free to split the last bit to a separate thread “Generalizing automatic object creation on Data Entry” if the thought interferes with my 1st question on collector creation.

Hi @pverley,

Thank you so much for your message and for your valuable feedback on the automatic creation of a new Collector upon CE creation. I’ve added a GitHub feature request for this:

We appreciate your suggestion!

I agree that a generalized approach would be best, and I’ll pass that along to our development team as well!

1 Like

Hi @pverley,

This has been expanded on in a new GitHub issue:

Can you take a look and let me know what you think?

Hi Grant,

Thanks for you effort in processing the various requests related to automatic relationship creation :folded_hands:

From a user perspective, the introduction of a new attribute autocreate to <cell type="subview"> feels natural and simple. Limit values to false (default) and true is the right way to go: simple for the end-user (leaves all the hard-work to the devs for implementing all the checks and safeguards :wink: )

You will have to think in due time an update/deprecation strategy between the two mechanisms. An automatic transition from current approach (CO_CREATE_COA, CO_CREATE_DET & CO_CREATE_PREP) to suggested new approach does not seem possible. Clear announcement should do the job? I would volunteer to give more thoughts to this question if it could help.

In a word: +1 for the unified “auto-create” framework :partying_face:

2 Likes