logo

NJP

How to make mandatory variables in the catalog task form?

Import · Apr 18, 2019 · article

Hello All,

Here is the code to make mandatory variables in the catalog task form

g_form.setMandatory('variables.variablename',true);

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

if (isLoading || newValue === '') {

return;

}

if(g_form.getValue("short_description")=="Asset Coordinator will close after ITSHOP request has been created"){

if(newValue=='3'){

g_form.setMandatory('variables.itsps_code',true);

g_form.setMandatory('variables.itsps_no',true);

}

else{

g_form.setMandatory('variables.itsps_code',false);

g_form.setMandatory('variables.itsps_no',false);

}

}

}

please mark help if it is useful to you

View original source

https://www.servicenow.com/community/csm-articles/how-to-make-mandatory-variables-in-the-catalog-task-form/ta-p/2297370