I created state value's reason fields into incident table and whenever state value changes

ashrkml321
Kilo Contributor
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
   var gr= g_form.getValue('state');

    g_form.setDisplay('u_open_reason', false);
    g_form.setDisplay('u_resolve_reason', false);
    g_form.setDisplay('u_hold_reason', false);
    g_form.setDisplay('u_close_reason', false);
    g_form.setDisplay('u_new_reason', false);
    g_form.setMandatory('u_open_reason', false);
    g_form.setMandatory('u_resolve_reason', false);
    g_form.setMandatory('u_hold_reason', false);
    g_form.setMandatory('u_close_reason', false);
    g_form.setMandatory('u_new_reason', false);

    if (gr==1)
    {
        g_form.setDisplay('u_open_reason', true);
        g_form.setMandatory('u_open_reason', true);
    }
    else if (gr==2)
    {
        g_form.setDisplay('u_new_reason', true);
        g_form.setMandatory('u_new_reason', true);
    }
    else if (gr==3)
    {
        g_form.setDisplay('u_hold_reason', true);
        g_form.setMandatory('u_hold_reason', true);
    }
    else if (gr==6)
    {
        g_form.setDisplay('u_resolve_reason', true);
        g_form.setMandatory('u_resolve_reason', true);
    }
    else if (gr==7)
    {
        g_form.setDisplay('u_close_reason', true);
        g_form.setMandatory('u_close_reason', true);
    }
 
 
}
 
I created state value's reason fields into incident table and whenever state value changes respective fields should be visible and mandatory. Please help me for this...
0 REPLIES 0