Title: Relations --- Relations & References A relation property links a record to one or more other records. It is the single, unified way to model references in the platform — replacing the older foreignId field and the free-floating links bag with one primitive. Relation properties are backed entirely by the relations collection. The reference value is never stored inline on the record; it lives as an edge in relations, which means reverse lookup ("what points at me?") is a single indexed query from either side — no scanning of other collections. Declaring a relation property A relation property is a normal schema property whose x-type-schema uses the relation input/view/filter widgets. Its behaviour is controlled by a small configuration: | Option | Effect | | --- | --- | | allowedTypeIds unset | Any record of any type may be linked (the old "links bag" behaviour). | | allowedTypeIds: ["companies"] | Single-type reference (the old foreignId behaviour). | | allowedTypeIds: ["contacts", "companies"] | Polymorphic — any of the listed types. | | type: "array" (minItems/maxItems) | Many cardinality — a list of references. A non-array property is one (single reference). | | inverse: { type, property } | Opt-in bidirectional pairing (see below). | | descriptions: { [typeKey]: InlineTranslation[] } | Preset link descriptions offered when creating an edge (see below). | Cardinality lives on the property, never in the relations store — the store stays a simple edge list. allowedTypeIds holds bare type ids, not full tenant-- collection names. The free-floating links property Every record type can opt into a built-in links relation property — a many-cardinality bag with no allowedTypeIds by default, so any record can be linked. It is configured from the type settings page (Verlinkungen section: enable, allowed types, and description presets) which writes the property into the type's schemaOverrides. Templates and feature extensions declare it statically via buildLinksRelationProperty. This replaces the legacy injected links bag; the edges it produces are tagged property: "links". Per-link descriptions A relation property may define descriptions, a map keyed by target type (full tenant collection name or bare type id) to a list of InlineTranslation presets. When the configured target type is chosen in the input widget, a description