How do I hide options on the Add an approval modal?

CCSF-Syd
Tera Expert

Hi all,

 

This is driving my team a bit bonkers - does anyone know how we can customize the values in the "wait_for" field in the Add an Approval Modal (mainly, how we can hide certain values)?

 

Thank you SO much for all the help in advance.

 

We're on Zurich

7 REPLIES 7

@CCSF-Syd ,

 

Go to the table where the modal opens (example: sysapproval_group or chg_approval_def).

 

Create a Client Script → Type = onLoad

 

2. Mark it for Workspace:

 

Make sure "UI Type" = All (or specifically Workspace).

 

That way it runs both in classic UI and in Workspace.

Client Script :

 

function onLoad() {

    // Hide unwanted choices from 'wait_for'

    g_form.removeOption('wait_for', 'workflow'); // removes Workflow

    g_form.removeOption('wait_for', 'process_flow'); // removes Process Flow

}

 

🔹wait_for = field name

🔹'workflow' / 'process_flow' = choice Value (not label, check your sys_choice )

 

3. Target only Workspace Modal (optional): If you want it to only apply when opened in Agent Workspace (not in classic UI), you can check:

 

function onLoad() {

    if (typeof window.NOW !== "undefined" && window.NOW.hasOwnProperty("workspaceConfig")) {

        // This means it's running inside Workspace

        g_form.removeOption('wait_for', 'workflow');

        g_form.removeOption('wait_for', 'process_flow');

    }

}

 

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain

ankitbanerj
Tera Expert

Hi @CCSF-Syd you want to add a modal inside a form or you just want to append another option for that approval field?

 

I want to REMOVE the two options I have striked out in red from that dropdown in the modal