Getting save changes message on case when no changes made

sid23
Mega Contributor

find_real_file.png

We have two fields called "reassignment reason" and "reassignment note". When a case is created these two fields do not show on the case form and this was achieved by having an onchange client script. Script below - 

Type - onChange
Script -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {

if (isLoading || newValue == oldValue || oldValue == '') {
g_form.setValue('u_reassignment_reason','');
g_form.setValue('u_reassignment_note','');
g_form.setDisplay('u_reassignment_note',false);
g_form.setMandatory('u_reassignment_reason',false);
g_form.setDisplay('u_reassignment_reason',false);

//return;
}
// if(newValue != oldValue && newValue!=''){
else
{
g_form.setValue('u_reassignment_reason','');
g_form.setValue('u_reassignment_note','');
g_form.setDisplay('u_reassignment_note',true);
g_form.setDisplay('u_reassignment_reason',true);
g_form.setMandatory('u_reassignment_reason',true);


}

//Type appropriate comment here, and begin script below
}

I believe this is causing the above issue. When a user changes the assignment group these two fields pop up and the user has to enter those two fields. And then the case is saved or submitted. But when the user opens the same case record and when the form loads these two fields disappear which is correct but i think the previous value entered by the user is still present in those two fields but just not visible due to the script above and as a result when the user does not make any change and tries to go back(click on the arrow on the header to go back) the save changes message appears.

Any help on this? or is what i am thinking is wrong and something else is causing this issue?

5 REPLIES 5

Shengavula Rath
Tera Expert

Hi Sid,

Is this your issue resolved ?