Integrate form fields from another table with a many-to-one relationship

I’d like to know if it’s possible to integrate a field from another table into a form with a many-to-one relationship?

For example, I can integer the “Collection name” field in the Collection object form like this (one-to-many):

<cell type="label" labelfor="CollectionName"/>
<cell type="field" id="CollectionName" name="collection.collectionName" uitype="dsptextfield"/>

But can I integrate the “Filed Number” field (and make it editable) from the Collection object table into the Collecting event form like this (many-to-one)?

<cell type="label" labelfor="ObjectFieldNumber"/>
<cell type="field" id="ObjectFieldNumber" name="collectionObject.fieldNumber" uitype="text"/>?

This doesn’t seem to work.

For the purposes of our collections, we need both field number fields, the one in the Collection Object table and the one in the Collecting Event table. At the moment the ‘Object fied number’ field is ‘outside’ the Collecting event information part in the form, which confuses most users. Is there a way of making the form more intuitive for users who don’t understand relational databases?

It would be great if I could put the two fields collectionObject.fieldNumber and collectingEvent.stationFieldNumber next to each other in the ‘Collecting infromation’ section.

Hi Marion,

Thank you for your question. After reviewing, we can confirm that you cannot edit the collectionObject.fieldNumber from within the Collecting Event form due to the database relationship between Collection Object (CO) → Collecting Event (CE).

Essentially, since there can be more than one CO linked to the CE in the database (see embedded vs. shared), Specify cannot determine which fieldNumber value to show, even if there is only one linked CO.

However, there is still a way to integrate the fields side-by-side on the data entry form.

You can add collectingEvent.stationFieldNumber to the Collection Object view definition. This will allow both field numbers to appear in the same section of the Collection Object form, with both fully editable.

<row>
	<cell type="label" labelfor="FieldNumber"/>
	<cell type="field" id="FieldNumber" name="fieldNumber" uitype="text" colspan="3"/>      
	<cell type="label" labelfor="Collecting Field Number"/>
	<cell type="field" id="Collecting Field Number" name="collectingEvent.stationFieldNumber" uitype="text" colspan="3"/>
</row>
<row>
	<cell type="subview" id="CollectingEvent" viewname="CollectingEvent" name="collectingEvent" colspan="24" rows="5"/>
</row>

Here is what a preview of an editable field.

image

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.