Member Junction
    Preparing search index...

    Interface CreateRelatedNavigationEvent

    A field (e.g. a foreign-key dropdown) is asking the host to create a NEW record of a related entity — typically because the user searched for one that doesn't exist yet.

    The Generic forms layer only emits this; it deliberately does not open the create form itself (that would couple a generic component to the app-layer form presenter). The host application opens the related entity's form (e.g. via MJFormPresenterService as a dialog or slide-in), prefilled with NewRecordValues, and — when the user saves — calls Complete with the new record so the requesting field can select it.

    case 'create-related': {
    const ref = this.forms.Open({
    EntityName: event.EntityName,
    Presentation: event.Presentation ?? 'dialog',
    NewRecordValues: event.NewRecordValues,
    Provider: event.Provider,
    });
    event.Complete(await ref.AfterSaved());
    break;
    }
    interface CreateRelatedNavigationEvent {
        Complete: (created: BaseEntity<unknown> | null) => void;
        EntityName: string;
        Kind: "create-related";
        NewRecordValues?: Record<string, unknown>;
        Presentation?: "dialog" | "slide-in";
        Provider?: IMetadataProvider;
    }
    Index

    Properties

    Complete: (created: BaseEntity<unknown> | null) => void

    Host callback: invoke with the saved record (or null if the user cancelled) so the requesting field can select it. Optional for the host to call — a host with no create surface can ignore the whole event.

    EntityName: string

    Entity to create a new record of (the FK field's related entity).

    Kind: "create-related"
    NewRecordValues?: Record<string, unknown>

    Default field values to prefill on the new record — lets the requester seed any fields (e.g. { Name: 'Marketing' } from the typed search text), not just the name.

    Presentation?: "dialog" | "slide-in"

    Preferred surface for the create form. The host may honor or override it.

    Metadata provider to use (multi-provider apps).