Dear Experts,

Recently we have upgraded our CRM version from UR 16 MS CRM 2011 to UR 18 MS CRM 2011 after upgrading we got an issue with one javascript. This javascript will update a field called case status in case entity on resolving the case. But it's not happening some times. Some times field is updating some times it's not updating we are unable to figure out the issue why it's not updating some times. we have checked the internet settings in the IE11 everything seems fine and our organization won't allow other browsers than IE 11. can you give me some suggestions below is my code for your reference

function updatecasestatus(context){

Xrm.Page.getControl("ccs_assignedto").setDisabled(false);
Xrm.Page.getControl("customerid").setDisabled(false);
var savebuttonmode = 1;
var resolvesavebuttonmode = 5;

var crmstatusfield = Xrm.Page.getAttribute("statecode").getSelectedOption().text;

// get Save method by getSavemode(), so for resovle button its '5'.
var savemode = context.getEventArgs().getSaveMode();

if(savemode == resolvesavebuttonmode )
{

var delayinresponse = Xrm.Page.getAttribute("ccs_delayinresponse").getValue();
if(delayinresponse == null || delayinresponse == 'undefined'){
alert('Please provide Delay in Responding details before closing');
context.getEventArgs().preventDefault(); 
return false;
}

var resolutionaccepted = Xrm.Page.getAttribute("ccs_resolutionaccepted").getValue();
if(resolutionaccepted == null || resolutionaccepted == 'undefined'){
alert('Please provide whether the resolution accepted or not by customer details');
context.getEventArgs().preventDefault(); 
return false; 
}
//end of change

Xrm.Page.getAttribute("ccs_srstatus").setValue(5);
var uguid=Xrm.Page.context.getUserId();
var un=Xrm.Page.context.getUserName();
var date=new Date();
alert(un);

// on submit mode for sr status field
Xrm.Page.getAttribute( "ccs_srstatus" ).setSubmitMode( "always" );
Xrm.Page.getControl("ccs_cust_language").setDisabled(false);

var buttonId = "incident|NoRelationship|Form|Mscrm.Form.incident.MainTab.Actions";
var resolveButton = window.top.document.getElementById(buttonId);

Xrm.Page.getAttribute("statecode").setValue(1);

if(resolveButton != null && resolveButton != 'undefined'){ 
//searchButton.disabled=true;
resolveButton.style.display="none";
}

//parent.window.location.reload(true);

}


var caseStatus = Xrm.Page.getAttribute("ccs_srstatus").getValue();
if (caseStatus != null && caseStatus != undefined){
if (caseStatus == 1){
Xrm.Page.getAttribute("ccs_srstatus").setValue(2);
Xrm.Page.getAttribute("ccs_srstatus").setSubmitMode("always");
}
}
//End of change

}

Regards,

Mahesh