Showing the upwards hierarchy of a linked term

In Axiell Collections, when you register the location of an object in your collection, it is sometimes handy to have an overview of the upwards hierarchy (the "context") of that location displayed in the record or in the Find data for the field window as well. You can implement this functionality for all fields which link to an internally linked field (possibly in the same database). If the desired context field is not present yet (as is the case in older application versions) you’ll have to make some changes to your Collections application to set up this functionality. You may add a context field to a detail screen and/or add a context field to a link screen: typically you'd like to have both.

Adding a context field to a detail screen (let's assume the linked location fields in Collect as our example):

1. Open the Application browser.
2. In the database table which holds the relevant linked field (current_location.name for example), the Collect database table in this example, create a new field of the data type Temporary or Text, which is sufficiently long to contain all the terms of your most extensive term hierarchy. Use a unique field tag and choose a meaningful field name. If you make it a Text field, then also mark the Do not show in lists option for the field. (The Collect database table in a model 4.5.2 application for example, already has the tags C1 for this purpose, and C2, C3 and C4 for other location fields.)
3. In the Context property on the Relations tab in the field properties of the linked field in the catalogue (which links to a field which in turn is internally linked to broader and narrower term fields), for example the current_location.name field, enter the tag or field name of the new field. (In a model 4.5.2 application for example, the current_location.name field has the current_location.context field (tag C1) as its context field.) Save the changes in this database table definition.
4. Place the new field somewhere on a screen, and make it read-only since it is only for display. In our example, the current_location.context field would fit well on the Location | Future movements screen (location.fmt). (In model 4.5.2 you can already find it there, right underneath 2A.) You could name the label for the new field Context or Location hierarchy, for example, or leave out the label. Save your changes.

Recycle the Collections IIS application pool and observe the results. Collections will automatically fill the new field with the hierarchical context of the linked term, yet only its broader terms and the term itself, in the following syntax: top_term/bt/bt/…/bt/term. So the hierarchy is presented as a single string, its broader terms separated by slashes. The displayed hierarchy won't be stored in the record.

If an entered location appears more than once in the database table, which may easily be the case for general location names like “shelf 1” or “rack 3”, you must select the right term when you leave the field. The More than one preferred term found, select from list window opens automatically, listing the identical terms. Hover the mouse pointer over a term, and a tooltip should now appear, showing the upwards hierarchy of the term. Do this over every term until you find the right one. Then select it and click OK.

In the linked field, you can also press Shift+F4 to select the desired location in the Find data for the field… window. You may find (depending on your application version) that the View table tab in this window lacks a context column to identify the desired non-unique location. The field columns you see on the View table tab are determined by the so-called link screen set up for the current linked field (see the Link screen option on the Link screens tab in the properties of a linked field in the database definition). (For the current_location.name field in model 4.5.2 for example, this is the lnk_location.fmt screen file.) Proceed as follows to add a context field column to a link screen:

1. Since a link screen contains fields from the linked database, we need to create a new field in the linked database, in Location in this example (4.5.2 already has some context fields, C1 being the relevant one for the current location) of the data type Temporary or Text, which is sufficiently long to contain all the terms of your most extensive term hierarchy. Use a unique field tag and choose a meaningful field name: part_of.context for example. If you make it a Text field, then also mark the Do not show in lists option for the field.
2. For the internally linked field in Location containing the broader location (tag 2A in Location in 4.5.2), now set the Context field property on the Relation fields tab to the actual context field (C1 for example). Save the changes in this database.
3. Place the context field on the link screen (lnk_location.fmt in this case). You can leave its properties to their default. Place the field somewhere in the row of fields already present, place the label above it and name it appropriately: Context or Location hierarchy, for example. If the link screen already contained an Is part of field (for the broader location only) you may consider removing that from the screen since the Context field will contain this information too. Save your changes.

Recycle the Collections IIS application pool. If you now open the Find data for the field window for any of the linked location fields in object records and switch to the View table tab, you should see the extra context column showing the upwards hierarchy for the selected location.
For the Change locations procedure in Axiell Collections, the same link screen is used when you look up available location names for the Location entry field.