Forcing document mode compatibility for IE: ASP.NET application talking to CRM 2013

Recently we faced an issue on ASP.NET application talking to CRM 2013, where document mode was always needed to be set to IE 9 in order for the UI elements and website controls to work properly. So, was digging on it and found the following way of doing it, add this to web.config:

<system.webServer>

<httpProtocol>

<customHeaders>

<clear />

<add name=”X-UA-Compatible” value=”IE=9″ />

</customHeaders>

</httpProtocol>

</system.webServer>

Following are possible values (referred from MSDN):

X-UA-Compatible value

Document modes

IE=5

Quirks mode

IE=7

IE7 mode

IE=8

IE8 mode

IE=9

IE9 mode

IE=10

IE10 mode

IE=11

IE11 mode

IE=edge

The highest supported document mode of the browser

IE=EmulateIE7

IE7 mode (if a valid <!DOCTYPE> declaration is present)

Quirks mode (otherwise)

IE=EmulateIE8

IE8 mode (if a valid <!DOCTYPE> declaration is present)

Quirks mode (otherwise)

IE=EmulateIE9

IE9 mode (if a valid <!DOCTYPE> declaration is present)

Quirks mode (otherwise)

IE=EmulateIE10

IE10 mode (if a valid <!DOCTYPE> declaration is present)

Quirks mode (otherwise)

IE=EmulateIE11

IE11 mode (if a valid <!DOCTYPE> declaration is present)

Quirks mode (otherwise)

Hope it helps!

Advertisement

{Tips and Tricks}Show/Hide Business Process Flow in CRM 2013 Form

Often, there is a case on CRM 2013 form, when we want to utilize the UI area for viewing details and have an ability to show/hide business process flow area:

Taking example of Sample opportunity Business process flow here:

clip_image002

We can click the arrow like this and the business process flow area collapses:

clip_image004

This is how it finally seems:

clip_image006

What if now I want to even hide this stuff and use the entire area? Something like(I am clicking the checkbox here on the form):

clip_image008

clip_image010

And when I move away from the checkbox:

clip_image012

The good fact about this approach is that if value of checkbox is saved, It is kind of sticky form view if checked on form load along with on change events. Now, the script:

function showHideBusinessProcessFlow()

{    if (Xrm.Page.getAttribute(“new_showbusinessprocessflow”).getValue() == true)

    {       $(“#header_process_d”).css(“display”, “block”);    }

    else    {           

  $(“#header_process_d”).css(“display”, “none”);

    }

}

Note: This is unsupported script and might break with future Microsoft updates.

Hope it helps!