How to stop the CRM Popup alert when you grab a window and re-host it to another tab, while suppressing the OnNewWindow event is a common issue that developers working with CCA have..
If you tried to suppress a CRM popup and redirect it… you've probably seen this message a few times:
So how do you get rid of it?
The 2 approaches I'm going to describe here work for CRM 3 and 4.0 only, they have not been tested or tried on CRM 2011, IE: Test before you commit.
In short. Please do not do this.
The way the CCA MCS team does this allows CRM to continue without server side changes and works for CRM UI elements hosted inside UII via a WebApplication adapter.
So how do we do it?
To do it, First you need a web application adapter, you can start one using the Visual Studio templates provided here, or if you already have one, you can use it.
Setting up the event hooks:
In your web application adapter you need to override the Initialize method and add in a new event hook for Document complete, this event hook is a lower level event hook then what you would get with the Adapters version of Document complete and should only be used for this purpose.
This will set up our event direct connection to the IE Instance’s Document completed event
Updating the function on the fly.
Next we need to build out that event handler, what when called will overwrite the in memory version of the crm handle popup blocker error function
The net result is that you will not get the popup blocker alert from CRM.
Few cautionary notes: ( disclaimers )
Changing the behavior of CRM is an unsupported modification.. so if you encounter errors in CRM, make sure disable this event and validate that the error is still there prior to calling support on it.
Future updates may change the name of the method that we update here. While that is unlikely, this is an unsupported on the fly modification. The CRM team is not required to guarantees the method name will not change.
This has been used and works successfully on CRM 3 and 4, this has not yet been run against CRM 2011..