Ga naar hoofdinhoud

CnRelatedObjectsWidget

Everything linked to an object, in one widget. Aggregates what an object relates to — through OpenRegister relations and leaf integrations — into grouped, clickable sections:

  • Objects — outgoing (uses), incoming (used) and contractual (contracts) relations, resolved from the object store.
  • Files — files attached to the object.
  • Linked apps — entry points into the leaf integrations that carry related content (mails, calendar events, …) for this object.

It is a Widget (not a Card): it renders on the shared CnWidgetWrapper chrome, so it carries the standard overflow Actions menu (Refresh / Documentation / Request a feature). Refresh refetches every section.

The detail-page auto-body renders this widget beneath CnObjectDataWidget automatically (manifest type: "detail" pages), and it is registered as the related built-in widget key for manifest grids.

Usage

<CnRelatedObjectsWidget
object-type="lead"
:object-id="lead.id"
:object-data="lead"
:store="objectStore"
@select-object="openObject"
@select-file="openFile"
@open-integration="openSidebarTab" />

Relation and file sections only render when the store exposes the matching actions (relationsPlugin / filesPlugin). Collections the store can't resolve generically (e.g. mails surfaced by a specific leaf) can be passed in via extra-sections.

Props

PropTypeDefaultDescription
titleString'Related'Widget title shown in the header
object-typeString''Registered object type slug (used for store fetches)
object-idString|Number''The object's id
object-dataObject{}The object data — used to derive id/type when not passed explicitly
schemaString''OpenRegister schema slug. When omitted, derived from objectData['@self'].schema. Required (with register) for the tabbed self-fetch path.
layoutString'tabs'Render mode. 'tabs' (default) self-fetches from OpenRegister and renders a tab per non-empty group. 'list' forces the legacy store-action list path.
storeObjectnullObject store instance. When omitted, the widget tries Pinia auto-detection.
show-objectsBooleantrueShow the related-objects (uses/used/contracts) section
show-filesBooleantrueShow the files section
show-contractsBooleanfalseInclude /contracts relations in the Objects group (opt-in).
show-integrationsBooleantrueShow the leaf-integration entry-point section
include-groupsArray[]Whitelist of relation-group keys to display (tabbed path). When non-empty, ONLY these render (e.g. ['objects', 'files', 'mails']); empty shows every non-empty group. Lets a detail page carry several Related widgets scoped to different relations. Keys: objects, files, and the leaf groups (mails, events, contacts, notes, tasks, deck, talk, forms, maps, polls, …). Configurable in-app via the widget's cog.
exclude-integrationsArray[]Integration ids to omit from "Linked apps" (on top of the always-omitted core tabs)
extra-sectionsArray[]Extra related sections the store can't resolve generically. Each: { key, label, icon?, items: [] }
documentation-urlString''Documentation link for the overflow Actions menu
widget-idString''Stable id forwarded to the widget chrome (falls back to object-type)
objects-labelString'Objects'Section heading for related objects
files-labelString'Files'Section heading for files
linked-apps-labelString'Linked apps'Section heading for leaf-integration entry points
open-in-sidebar-labelString'Open in sidebar'Deprecated no-op label kept for backward compatibility. No longer rendered in tabbed mode.
empty-labelString'Nothing related yet'Empty-state label shown when nothing is related

Events

EventPayloadDescription
@select-objectrelated object recordA related-object row was clicked
@select-filefile recordA file row was clicked
@select-extra{ section, item }A row in a host-supplied extra-sections group was clicked
@open-integrationintegration id (string)A "Linked apps" row was clicked — the host opens that leaf (the detail-page auto-body deep-links the sidebar tab)