It is now possible to add layering at the level of custom entities by using subtypes.
What are the benefits of subtypes?
How do I create subtypes?
1 What are the benefits of subtypes?
Grouping of entities
By creating main and sublevels, you can group entities. This indicates that these entities belong together. For example, to record different types of tools. Within the custom entities, the main values drill presses, saw presses, grinders are created. Within drills, the different types of drills are added as subtypes, such as cordless drills, impact drills, etc. This way it is immediately clear in which group a certain machine belongs.
Prevent double fields
You will want to add fields on the entities. Some fields are needed on every entity, for instance the field brand or type. No matter whether you register a drilling machine or a saw machine, the make field is always necessary. Without using subtypes, these fields have to be created multiple times on every entity. With subtypes, you add this field once to the highest level, making it visible on the lower levels as well.
In our tools example, this means we have three levels:
Tools (brand, type) | Drill (power, battery life) | Hammer drill |
|
| Cordless drill |
|
| Wood drill |
At the Tool level, add the fields, which you also need for the subtypes.
At Drill level, add the fields that apply to all drills, but not to saws, grinders, etc.
At the level of Hammer Drill, add any fields that apply only to a hammer drill, but not to the cordless drill, wood drill etc.
2 How do I create subtypes?
The administrator can create custom entities and subtypes.
Navigate to configuration.
Open the custom entities menu.
Click the + custom entity button, enter the name of the entity and save it.
Open the new entity.
If necessary, add all fields on the fields tab. It is also possible to do this later.
Click the subtype tab and enter the subtypes using the + button.
Create yet another layer by clicking on the created subtype and repeat the process.
Under the + button in the top bar, all activated entities are shown, allowing users to easily create new data.
Make sure that only those entities are visible here that are necessary for a user, i.e. the hammer drill and cordless drill, but not the drill or tool entity. You can hide
these by deactivating the slider on the custom entities.