Get rid of "Do you want to close this window?"

You might get a question when opening CRM in Internet Explorer. The question is:


The webpage you are viewing is trying to close the window.
Do you want to close this window?
yes no

This message does appear in CRM 4.0 only when you are using Internet Explorer 7.0 and you have enabled the application mode setting. Nevertheless, it is an anoying message which you can get away!

To get rid of this message open the default.aspx file which resides in the root of the CRM website. In this file there are these three lines of code:

var oMe = window.self;
oMe.opener = window.self;
oMe.close();

Modify the second line of this snippet and end up with these three lines:

var oMe = window.self;
oMe.open('','_self','');
oMe.close();

You now will not have the message anymore. Keep in mind that any update or migration might remove this change, but you should be able to reapply the change easily again.

6 comments:

Stephen Maij said...

And you can get rid of the CRM 4.0 close alert too by using:

//CLOSE SCRIPT
var CRM_FORM_TYPE_CREATE = "1";
if (crmForm.FormType == CRM_FORM_TYPE_CREATE)
{
alert('Er mag geen nieuw record worden aangemaakt via Microsoft CRM, gebruik hiervoor ....');
crmForm.detachCloseAlert();
self.close();
return;
}

DoctaJonez said...

Thanks Ronald,

That is easier than rolling out IE security changes across my entire domain.

Thanks again for these useful gems that you give us on your page :)

DoctaJonez

vishal swami said...

Thanks Ronald for these useful tips that were really helpful.

Bernard Grand, Nerea said...

Thanks ! As usual, your advises are verry useful to us :)

Saritha said...

How do you get rid of this in IE8? This solution doesn't seem to be working. :(
And yes, it is annoying!

Neil said...

You can also copy those three lines into the javascript OnSave event of any of the affected entities. At least that way the changes will be copied over with you customisations