{% macro field_form_fields(key, name, data_type, is_required, is_unique, is_business_key_component, type_choices, include_key=false, definition='', unit='', lock_constraints=false, lock_identifier=false, hierarchy=false, hierarchy_scope='leaves', field_id_prefix='field') -%} {% set selected_type = type_choices|selectattr('id', 'equalto', data_type)|first %} {% if include_key %}

Generated from the name until you edit it. Used in exports and the API. It can be changed until the first version is published.

{% endif %}

Optional explanation of meaning and intended use. Maximum 4000 characters.

Optional label such as EUR, kg, % or days. Maximum 64 characters; no conversion or calculation.

{% if hierarchy %}

Leaves have no children, at any depth. All nodes also includes the root and intermediate branches. Values outside the scope are retained as inactive.

{% endif %}

Identifies each record together with the other identifier fields. Float cannot be part of a Record identifier.

Required for Record identifier fields.

{{ 'Every node in the field’s scope needs a value.' if hierarchy else 'Every record needs a value.' }}

{% if is_business_key_component and not lock_constraints %}{% endif %}

{{ 'No two nodes in the field’s scope may share a value. Inactive values are excluded.' if hierarchy else 'No two records may share a value.' }}

{% if hierarchy %}

Optional. The record identifier identifies leaves only and can be configured after building the hierarchy.

{% endif %} {%- endmacro %}