Removing event.returnValue after installing Dynamics CRM 2011 UR 12

Application will throw script error when you click save ribbon button on form.

Reason:

UR 12 for CRM 2011 now supports multiple browser (see article http://msdn.microsoft.com/en-us/library/hh771584.aspx). To support multi browser some of form object/element has been changed (which was specific to IE).

Resolution:

  1. Recommended Solution: Use “Xrm.Page.context.getEventArgs.preventDefault()” method instead of event.returnValue (see http://msdn.microsoft.com/en-us/library/gg509060.aspx).
  2. Quick Fix for IE: turn on HTC support in the system settings of the organization. This fix is for IE only, if you want to use other browser for CRM use first solution.

Example:

var i;
function OnSaveOperation()
{
if(i==1){
// if i is iqual to one prevent form save operation.
Xrm.Page.context.getEventArgs.preventDefault();
}

//code logic goes here.
}