@servicenow/sdk - v4.7.0
    Preparing search index...

    Interface UiAction<T>

    interface UiAction<T extends TableName> {
        $id: string | number | ExplicitKey<string>;
        $meta?: { installMethod?: "first install" | "demo" | "once" };
        $override?: Record<string, string | number | boolean>;
        actionName?: string;
        active?: boolean;
        client?: {
            isClient?: boolean;
            isUi11Compatible?: boolean;
            isUi16Compatible?: boolean;
            onClick?: string;
        };
        comments?: string;
        condition?: string;
        excludeFromViews?: string[];
        form?: {
            showButton?: boolean;
            showContextMenu?: boolean;
            showLink?: boolean;
            style?: "primary"
            | "destructive"
            | "unstyled";
        };
        hint?: string;
        includeInViews?: string[];
        isolateScript?: boolean;
        list?: {
            showBannerButton?: boolean;
            showButton?: boolean;
            showContextMenu?: boolean;
            showLink?: boolean;
            showListChoice?: boolean;
            showSaveWithFormButton?: boolean;
            style?: "primary"
            | "destructive"
            | "unstyled";
        };
        messages?: string[];
        name: string;
        order?: number;
        overrides?: string
        | Record<"sys_ui_action">;
        protectionPolicy?: "read" | "protected";
        roles?: (string | Role)[];
        script?: string | ((current: any, ...params: any[]) => void);
        showInsert?: boolean;
        showMultipleUpdate?: boolean;
        showQuery?: boolean;
        showUpdate?: boolean;
        table: T;
        workspace?: {
            clientScriptV2?: string;
            isConfigurableWorkspace?: boolean;
            showFormButtonV2?: boolean;
            showFormMenuButtonV2?: boolean;
        };
    }

    Type Parameters

    Index

    Properties

    $id: string | number | ExplicitKey<string>
    $meta?: { installMethod?: "first install" | "demo" | "once" }

    Type Declaration

    • OptionalinstallMethod?: "first install" | "demo" | "once"

      Map a record to an output folder that loads only in specific circumstances. 'first install' -> 'unload' (only loaded when plugin is first registered), 'demo' -> 'unload.demo' (only loaded when demo data is loaded), 'once' -> 'apply_once' (scripts that are only applied once)

    $override?: Record<string, string | number | boolean>

    Set properties not directly supported by this API.

    actionName?: string

    unique string that can be referenced in scripts

    active?: boolean

    If true, the UI Action is enabled

    client?: {
        isClient?: boolean;
        isUi11Compatible?: boolean;
        isUi16Compatible?: boolean;
        onClick?: string;
    }

    If client side script and related properties

    comments?: string

    text field used by developers and admins to add internal notes

    condition?: string

    A script or condition that determines whether the UI Action is visible.

    excludeFromViews?: string[]

    Specifies views from which UI action to be excluded TODO: Add support for sysid references

    form?: {
        showButton?: boolean;
        showContextMenu?: boolean;
        showLink?: boolean;
        style?: "primary" | "destructive" | "unstyled";
    }

    UI action on form view and related properties

    hint?: string

    a tooltip or hover text that appears when users hover their mouse pointer over

    includeInViews?: string[]

    Specifies views in which UI action to be included TODO: Add support for sysid references

    isolateScript?: boolean

    Checked, script in a UI Action runs in an isolated script

    list?: {
        showBannerButton?: boolean;
        showButton?: boolean;
        showContextMenu?: boolean;
        showLink?: boolean;
        showListChoice?: boolean;
        showSaveWithFormButton?: boolean;
        style?: "primary" | "destructive" | "unstyled";
    }

    UI action on list view and related properties

    messages?: string[]

    messages field holds user facing messages or text that are accessed via the getMessage or getMessages API in client scripts

    name: string

    name of the UI Action. It must be unique within the table

    order?: number

    Determines the order in which the UI Action appears. Lower values show first.

    overrides?: string | Record<"sys_ui_action">

    Action being overridden by the current record

    protectionPolicy?: "read" | "protected"

    Controls edit/view access for other developers after the application is installed.

    • read: Others can see the script logic but not change it.
    • protected: Others cannot change this record.
    • Omit to allow other developers to customize this record.
    roles?: (string | Role)[]

    stores roles associated with a UI Action, defining which users can see or execute that UI Action based on their roles TODO: Add support for sysid references

    script?: string | ((current: any, ...params: any[]) => void)

    Script runs automatically as part of the UI Action when the client calls it. Note: server module scripts (sys_module) can only be used on server-side UI Actions.

    showInsert?: boolean

    Checked, the UI Action appears in insert

    showMultipleUpdate?: boolean

    Checked, the UI Action appears in insert, update, query or update multiple(bulk edit) mode.

    showQuery?: boolean

    Checked, the UI Action appears in insert, update, query or update multiple(bulk edit) mode.

    showUpdate?: boolean

    Checked, the UI Action appears in update

    table: T

    table on which UI Action appears

    workspace?: {
        clientScriptV2?: string;
        isConfigurableWorkspace?: boolean;
        showFormButtonV2?: boolean;
        showFormMenuButtonV2?: boolean;
    }

    UI action on workspace configuration and related properties