Member Junction
    Preparing search index...

    Picks the form to render for an entity record and exposes the full list of applicable variants so the toolbar's variant switcher can offer alternates.

    Tier order for the default pick:

    1. EntityFormOverride row matching the caller's User/Role/Global scope, Status='Active', ordered by scope tier (User > Role > Global), then Priority DESC, then __mj_CreatedAt DESC. First row wins.
    2. Existing ClassFactory.GetRegistration(BaseFormComponent, entityName) — the
    • CodeGen-generated path used today. 3. None — caller surfaces the "no form registered" error.

    Standard form. Every resolution also carries standard, the CodeGen-generated form (ResolveStandardForm). Tiers 1 and 2 can both hide it — an override replaces it, and a custom @RegisterClass with a higher priority outranks it — so hosts use it as an escape hatch to reach every field of the entity.

    Session selection. If the user previously chose a non-default variant via the variant switcher and that choice is still applicable + Active, that choice wins over the default. Choice is keyed by entity name in localStorage. Honoring this is part of the variant-switcher contract; without it, switching variants would only last for the lifetime of the record-form view.

    Performance. Backed by InteractiveFormsEngine (in MJCoreEntities) — overrides are cached in memory with BaseEntity event-driven invalidation, so resolution is an O(N) JS filter against a small set instead of a per-LoadForm RunView round-trip. Cold latency dropped from ~50ms to <1ms after the first load. The engine is lazy-Config'd here on first resolution; users who never open a record pay nothing.

    Index

    Constructors

    Properties

    EXPLICIT_DEFAULT_SENTINEL: "__codegen-default__" = FORM_VARIANT_EXPLICIT_DEFAULT

    Sentinel stored in localStorage when the user explicitly picks the "Default form" option from the variant picker. Distinct from a missing localStorage key (= "no preference, use auto-pick rules") and from an override UUID. Without this sentinel, picking "Default" cleared the preference and pickActive re-applied the auto-pick — which always selects the first Active override, making the CodeGen/Angular fallback unreachable from the UI.

    Format: a leading __ makes it visually distinct from a UUID and impossible to collide with one (UUIDs don't contain underscores).

    Methods

    • Wipe the user's stored preference for this entity. Next load applies the auto-pick rules (first Active override in tier order). Called internally when a saved override ID is no longer valid. Fire-and-forget — the resolver doesn't need to await the delete.

      Parameters

      • entityName: string

      Returns void

    • Read the user's previously-saved variant choice for the entity. Synchronous because UserInfoEngine keeps the user-settings table in memory after bootstrap. Returns the stored UUID, the explicit- default sentinel, or null when no preference exists.

      Parameters

      • entityName: string

      Returns string | null

    • The CodeGen-generated ("standard") form class for an entity, or null when no class form is registered.

      Why lowest priority = standard. CodeGen emits @RegisterClass(BaseFormComponent, '<Entity>') with no priority, so ClassFactory auto-assigns highest + 1 at registration time. A custom form either declares a higher explicit priority or extends the generated class (so it loads after it and gets a higher auto priority). The generated form is therefore the lowest-priority registration for the key. On a priority tie the FIRST registered wins here — the opposite of ClassFactory's winner rule (last wins), which is what makes a tied custom form outrank the generated one. With exactly one registration, that registration is the standard form.

      Parameters

      Returns Type<BaseFormComponent> | null

    • Record that the user explicitly picked the "Default form" row in the picker. pickActive reads this sentinel and returns null even when Active overrides exist for the entity, so the form-loading path falls back to CodeGen's @RegisterClass lookup.

      Parameters

      • entityName: string

      Returns void