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

    Interface UiPolicy<T>

    Type representing the complete configuration of a UI Policy with metadata.

    interface UiPolicy<T extends TableName> {
        $id: string | number | ExplicitKey<string>;
        $override?: Record<string, string | number | boolean>;
        actions?: UiPolicyAction<T>[];
        active?: boolean;
        conditions?: string;
        description?: string;
        global?: boolean;
        inherit?: boolean;
        isolateScript?: boolean;
        modelId?: string;
        modelTable?: T;
        onLoad?: boolean;
        order?: number;
        protectionPolicy?: "read" | "protected";
        relatedListActions?: UiPolicyRelatedListAction[];
        reverseIfFalse?: boolean;
        runScripts?: boolean;
        scriptFalse?: string;
        scriptTrue?: string;
        setValues?: string;
        shortDescription: string;
        table?: T;
        uiType?: uiType;
        view?: string | Record<"sys_ui_view">;
    }

    Type Parameters

    Index

    Properties

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

    Set properties not directly supported by this API.

    actions?: UiPolicyAction<T>[]

    List of actions to perform when the UI Policy condition is met

    active?: boolean

    Whether the UI Policy is active

    conditions?: string

    A condition script or query that determines when the UI Policy applies

    description?: string

    Detailed description of the UI Policy

    global?: boolean

    Whether the UI Policy applies globally across all applications

    inherit?: boolean

    Whether the UI Policy is inherited by tables that extend this table

    isolateScript?: boolean

    Whether to run the script in an isolated scope

    modelId?: string

    Model ID for the UI Policy

    modelTable?: T

    Model table for the UI Policy

    onLoad?: boolean

    Whether the UI Policy runs when the form loads

    order?: number

    Order/priority of the UI Policy execution

    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.
    relatedListActions?: UiPolicyRelatedListAction[]

    List of related list visibility controls

    reverseIfFalse?: boolean

    Whether to reverse the actions when the condition is false (renamed from 'reverse' for clarity)

    runScripts?: boolean

    Whether to run the scripts defined in scriptTrue/scriptFalse

    scriptFalse?: string

    JavaScript code that runs when the condition evaluates to false

    scriptTrue?: string

    JavaScript code that runs when the condition evaluates to true

    setValues?: string

    Values to set when the UI Policy is applied

    shortDescription: string

    A brief description of what the UI Policy does (required and must not be empty)

    table?: T

    The table to which the UI Policy applies (optional)

    uiType?: uiType

    User interface to which the UI Policy applies

    view?: string | Record<"sys_ui_view">

    View context where the UI Policy applies (sys_ui_view reference or name). If global is true, the UI Policy applies to all form views. If global is false/undefined, specify a view to make the policy view-specific.