1. Home
  2. Administrators
  3. Data fields
  4. How to create an associative tab

How to create an associative tab

Document categories in Docuo can be related to each other by means of Drop-Down List to Other Category (LDAOC) fields. These fields relate ONE document from one category to SEVERAL documents from the other.

In some scenarios it is necessary to relate SEVERAL documents of one category to SEVERAL documents of another. This article explains how to do this.

ONE to MANY relationships in Docuo

Let’s assume two categories, one for Students and one for Provinces. The Pupils category has a field of type LDAOC that allows to choose the province to which the pupil belongs. The following diagram shows the relationship:

In this type of relationship, ONE province can be assigned to SEVERAL students. We can see that the province Madrid is assigned to the students Andrés Ramírez and Cristina Albéniz.

Each student can only be assigned to one province

In the student details window, we will have the “Province” field,
where we can choose ONE province (the student’s province).

In the provinces details window we will have the “Students” tab,
where we will be able to see a list with the SEVERAL students assigned to that province.

VARIOUS to VARIOUS relationships in Docuo

Let us now look at a different problem with another example: If we want to associate the students of a university with the different subjects in which they are enrolled. Unlike the previous problem we now find that:

El mismo alumno puede estar matriculado en VARIAS asignaturas y la misma asignatura puede ser impartida a VARIOS alumnos.

To solve this problem in Docuo, we must create a third category that associates the values of the other two. We call this type of category “ASSOCIATIVE CATEGORY”, which is shown in yellow in the diagram:

We can see that the associative category manages that Luisa is enrolled in mathematics and chemistry and also that Andres and Cristina are the students enrolled in physics.

For a category to be associative it only needs two fields of type List Deployable to Other Category (LDAOC) that point to the categories to be associated.

The associative category could have more fields, such as the grade that student has obtained in that subject.

If we follow these instructions, to say that a student is enrolled in a subject, we have to manually create a record in “Students and Subjects”. Similarly, if we want to delete the association, we must delete that record.

This user experience is not satisfactory from the user’s point of view. The following section shows how to use an “associative tab” to improve it.

Differences between a “normal tab” and an “associative tab”.

Experience of use in a “normal tab”.

Continuing with the previous example, let’s see what Luisa Gomez’s student file looks like in Docuo:

On the right we can see Luisa’s associations with her subjects: Chemistry and Mathematics.

If we now want Luisa to enroll in Physics, i.e. to create a new association, we would have to click on the “New document” button in the Students and Subjects tab and choose in the Subject field the value “Physics”:

By clicking “Save and close”, we would create the new associative record and Luisa would be associated to the three subjects:

This experience of use may be valid for a few records, but if we were to associate a student with 15 subjects, we would have to click 15 times on “New document” in his record, and go choosing the 15 values, which is not very efficient.

Experience of use in an “associative tab”.

Suppose we have a new student: Cristina Albéniz, and we want to enroll her in Mathematics and Chemistry:

The first thing we see is that the old “New Document” button is now called “Add”. Let’s click it:

We can directly mark the two subjects in which Cristina is going to enroll. When you click OK in the dialog, two records will be automatically created in “Students and Subjects”:

How to convert a “normal” tab into an “associative” tab.

Let’s take a look at how the “Students and Subjects” tab is configured by default when it is a “normal tab”:

Docuo detects that “Students and Subjects” could be an associative category and offers the option to display this tab as an “Associative Tab”. Let’s see how the configuration looks like if we activate this check:

Docuo now understands that the main function of this tab is to create and delete “Students and Subjects” records and will make this easier for the user.

Below we explain some options of the associative tab configuration:

“Double click opens the associated document”

If this option is checked, when the user double-clicks on the association with a subject from a student (e.g.“Luisa Gómez enrollment in Physics“), the subject (“Physics“) will be opened instead of the associative record.

This way you can make the user not even know that the associative category exists.

“Show new”

If this option is checked, when the user is assigning records, the “New document” button will be displayed, allowing the user to create new records in the associated category (a new subject in the example):

“Cascade delete”

The cascade deletion checks allow that, when deleting a student, all its associations with subjects are deleted (upper check), or that when deleting a subject all its associations with students are deleted (lower check), both options can be checked at the same time.

“Show associates”

If enabled, users can use the “Add” dialog box to both add and remove associations (previously checked records will also appear in the list of checks).

If unchecked (default), users will have to manually remove the associations using the “Remove” option on the tab and when trying to “Add”, only records in the associated category that are not already associated will appear.

Updated on 22 de October de 2024
Was this article helpful?

Related Articles