Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to hide mandatory variable

krishna87654
Kilo Expert

How to hide mandatory variable in catalog item. This variable is mandatory in variable set

1 ACCEPTED SOLUTION

krishna87654
Kilo Expert

It is working with UI Policy with condition Mandatory, visible, read only to false.


View solution in original post

20 REPLIES 20

function onLoad(control, oldValue, newValue, isLoading) {

g_form.setMandatory('u_environment_catalog', false);
g_form.setDisplay('u_environment_catalog', false);

}

I tried this script but doesn't work for me

You tried this as well?:

Below changed to setVisible

function onLoad(control, oldValue, newValue, isLoading) {
    g_form.setMandatory("u_environment_catalog", false);
    g_form.setVisible("u_environment_catalog", false);
}

Hi Williem,
Yes, I tried setvisible as well but doesn't works.

Regards,
Krishna N.

It is working with UI Policy with condition Mandatory, visible, read only to false.