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.

Hide choice in interaction state field failed in ATF

Community Alums
Not applicable

Hi,

 

I have created below client script to hide state choice based on condition. Its working fine but getting failed while testing using ATF.

 

function onLoad() {
if (g_form.getValue('state') == 'new'){
    g_form.removeOption('state', 'on_hold');
}
if (g_form.getValue('state') == 'on_hold'){
    g_form.removeOption('state', 'new');
    g_form.removeOption('state', 'closed_abandoned');
    g_form.removeOption('state', 'closed_complete');
}
if (g_form.getValue('state') == 'closed_abandoned'){
    g_form.removeOption('state', 'new');
    g_form.removeOption('state', 'work_in_progress');
    g_form.removeOption('state', 'on_hold');
    g_form.removeOption('state', 'closed_complete');
}
if (g_form.getValue('state') == 'closed_complete'){
    g_form.removeOption('state', 'new');
    g_form.removeOption('state', 'work_in_progress');
    g_form.removeOption('state', 'on_hold');
    g_form.removeOption('state', 'closed_abandoned');
}
}
0 REPLIES 0