@servicenow/sdk - v4.7.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?: field_type<T, E>;
        global?: G;
        isolate_script?: boolean;
        isolateScript?: boolean;
        messages?: string;
        name: string;
        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?: G extends false ? string : never;
    }

    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?: field_type<T, E>

    Field on the table that the client script applies to. This property applies only when the type property is set to onChange or onCellEdit.

    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

    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?: G extends false ? string : never

    Views of the table on which the client script runs. This property applies only when the global property is set to false