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

    Interface ClientScriptProps<T, E, G>

    interface ClientScriptProps<
        T extends TableName,
        E extends client_script_events,
        G extends boolean,
    > {
        $id: string | number | ExplicitKey<string>;
        $meta?: { installMethod?: "first install" | "demo" | "once" };
        $override?: Record<string, string | number | boolean>;
        active?: boolean;
        applies_extended?: boolean;
        appliesExtended?: boolean;
        description?: string;
        field?:
            | string & {}
            | "sys_created_on"
            | "sys_created_by"
            | "sys_updated_on"
            | "sys_updated_by"
            | "sys_id"
            | "sys_mod_count"
            | keyof (
                Tables[T]["extends"] extends E
                    ? Tables[E] extends { schema: object }
                        ? Schema<T> & (
                            Tables[E]["extends"] extends E
                                ? Tables[E] extends { schema: object }
                                    ? Schema<E> & (
                                        Tables[E]["extends"] extends infer E extends string ? Tables[E] extends { schema: object; } ? Schema<E> & (Tables[E]["extends"] extends infer E extends string ? Tables[E] extends { ...; } ? Schema<...> & ... 1 more ... & PlatformColumns : Schema<...> : Schema<...>) & PlatformColumns : Schema<...> : Schema<...>
                                    ) & PlatformColumns
                                    : Schema<E>
                                : Schema<E>
                        ) & PlatformColumns
                        : Schema<T>
                    : Schema<T>
            );
        global?: G;
        isolate_script?: boolean;
        isolateScript?: boolean;
        messages?: string;
        name: string;
        order?: number;
        protectionPolicy?: "read" | "protected";
        script?: string;
        table: T;
        type?: E;
        ui_type?: "desktop" | "all" | "mobile_or_service_portal";
        uiType?: "desktop" | "all" | "mobile_or_service_portal";
        view?: string;
    }

    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.

    active?: boolean

    Whether the record is enabled

    applies_extended?: boolean

    Indicates whether the client script applies to tables extended from the specified table

    appliesExtended?: boolean

    Indicates whether the client script applies to tables extended from the specified table

    description?: string

    Description of the functionality and purpose of the client script

    field?:
        | string & {}
        | "sys_created_on"
        | "sys_created_by"
        | "sys_updated_on"
        | "sys_updated_by"
        | "sys_id"
        | "sys_mod_count"
        | keyof (
            Tables[T]["extends"] extends E
                ? Tables[E] extends { schema: object }
                    ? Schema<T> & (
                        Tables[E]["extends"] extends E
                            ? Tables[E] extends { schema: object }
                                ? Schema<E> & (
                                    Tables[E]["extends"] extends infer E extends string ? Tables[E] extends { schema: object; } ? Schema<E> & (Tables[E]["extends"] extends infer E extends string ? Tables[E] extends { ...; } ? Schema<...> & ... 1 more ... & PlatformColumns : Schema<...> : Schema<...>) & PlatformColumns : Schema<...> : Schema<...>
                                ) & PlatformColumns
                                : Schema<E>
                            : Schema<E>
                    ) & PlatformColumns
                    : Schema<T>
                : Schema<T>
        )

    Field on the table that the client script applies to. Takes effect only when type is set to onChange or onCellEdit; a warning is emitted at build time if set with other event types.

    global?: G

    Indicates which views of the table the client script runs.

    • true: the script runs on all views
    • false: the script runs only on specified views
    isolate_script?: boolean

    Indicates whether scripts run in strict mode, with access to direct DOM, jQuery, prototype, and the window object turned off

    isolateScript?: boolean

    Indicates whether scripts run in strict mode, with access to direct DOM, jQuery, prototype, and the window object turned off

    messages?: string

    Strings that are available to the client script as localized messages using getmessage('[message]').

    name: string

    Name of the client script

    order?: number

    The execution order of the client script (lower numbers execute first)

    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.
    script?: string

    Script to be executed when the client script runs

    table: T

    Name of the table on which the client script runs

    type?: E

    Type of client script, which defines when it runs

    ui_type?: "desktop" | "all" | "mobile_or_service_portal"

    User interface to which the client script applies

    uiType?: "desktop" | "all" | "mobile_or_service_portal"

    User interface to which the client script applies

    view?: string

    Views of the table on which the client script runs. Only effective when global is false; ignored otherwise.