Skip to content

RelatedModel

RelatedModel = object

Defined in: packages/schema/src/model.ts:946

Records of another resource on the record page: those whose field holds this record’s key or, with through, those whose field holds one of the key values of the through records that point at this record (a join table). With from, those whose field holds the value of that field of this record. See Related records.

optional actions?: string[]

Defined in: packages/schema/src/model.ts:984

Named actions of resource’s view, by name, as buttons on each card; only with presentation: 'cards' or 'compact'.


optional button?: RowButtonModel

Defined in: packages/schema/src/model.ts:990

A button on each row, or each card, to an address its fields name.


optional columns?: string[]

Defined in: packages/schema/src/model.ts:975

Fields of resource, through relations too (unitId.propertyId): the table’s columns, or the fields each card shows.


optional count?: boolean

Defined in: packages/schema/src/model.ts:1005

Show how many records match beside the title, such as “Open tasks 3”, as the reader may see them.


optional display?: string

Defined in: packages/schema/src/model.ts:999

The display of resource’s list it opens in, such as cards; the list’s default when omitted.


optional empty?: string

Defined in: packages/schema/src/model.ts:1001

The text when nothing matches.


field: string

Defined in: packages/schema/src/model.ts:956

The filterable field of resource matched against this record’s key, or with through against the join records’ keys, or with from against that field’s value.


optional filter?: string

Defined in: packages/schema/src/model.ts:971

An AIP-160 filter on the listed records.


optional from?: string

Defined in: packages/schema/src/model.ts:958

A field of this record whose value field is matched against instead of its key; not with through.


optional help?: string

Defined in: packages/schema/src/model.ts:952

A line under the title.


optional hideEmpty?: boolean

Defined in: packages/schema/src/model.ts:1003

Leave the section off the page while it has no records.


kind: "related"

Defined in: packages/schema/src/model.ts:948

A related records section.


optional limit?: number

Defined in: packages/schema/src/model.ts:997

How many records it shows, the first in sort order; with more, it says so (“The first 10 of 37.”) beside “View all”, which opens the rest in the list.


optional lines?: true

Defined in: packages/schema/src/model.ts:1013

The record’s lines, such as an invoice’s: every record of resource within this one, in their .position() order, shown whole and edited in place on the record’s form, saved with it; see Record lines.


optional open?: string

Defined in: packages/schema/src/model.ts:995

The relation field of resource whose record a row opens, for rows that are links between this record and another (a join resource); by default the one relation in resource’s primary key besides field, when there is exactly one.


optional presentation?: RelatedPresentation

Defined in: packages/schema/src/model.ts:982

cards shows each record as a card stacked full width, its columns and actions on it; compact as a card of one or two lines, its title and time on the first, its columns inline without labels and its actions beside them; record shows the columns of the first record in full, with a link to its page; the list’s table or display when omitted.


resource: string

Defined in: packages/schema/src/model.ts:954

The resource whose records it lists.


optional sort?: string

Defined in: packages/schema/src/model.ts:973

An AIP-132 order of the listed records.


optional through?: object

Defined in: packages/schema/src/model.ts:960

The join records between this record and the listed ones.

field: string

Its filterable relation that holds this record’s key.

optional filter?: string

An AIP-160 filter on the join records.

optional key?: string

Its field whose values pick the listed records; its primary key when omitted.

resource: string

The join resource.


optional time?: string

Defined in: packages/schema/src/model.ts:986

A date or timestamp field of resource each compact card shows beside its title, as its view formats it; only with presentation: 'compact'.


title: string

Defined in: packages/schema/src/model.ts:950

The section’s title.


optional tone?: string

Defined in: packages/schema/src/model.ts:988

An enum field of resource whose value colours each card’s left edge, by its view’s valueColors; only with cards.


optional when?: RecordWhen

Defined in: packages/schema/src/model.ts:1007

Whether it shows on the form, the read view or both, or a condition on the saved record that it shows while it holds.