One of the things we ran into with our recent upgrade projects (Microsoft Dynamics CRM 4.0 to CRM 2011) is that there are a lot of tabs with IFRAMEs to custom pages on the contact form. The CRM 2011 form load performance was very slow after the upgrade where we are loading all the IFRAMEs on load of the form by default. Then we tried adding code to load these IFRAMEs on the “TabStateChange” event of the corresponding tabs. To accomplish this, we followed the following steps:


1. The tabs should be collapsed by default.

CRM 2011 Form Load Performance

2. And also, the URL for the IFRAME in the form customization should be set to “about:blank” so that nothing loads by default. When the user clicks on the tab link in the Left navigation on the form, the tab will be automatically expand in the CRM UI

CRM Form Load

3. Here is the code snippet we added to the TabStateChange Event function call.

function tab_custom_onstatechange() {

if (Xrm.Page.ui.tabs.get(“tabname”).getDisplayState() == “expanded”) {

var IFrame = Xrm.Page.ui.controls.get(“IFRAME_Name”);

IFrame.setSrc(‘Custom URL for the destination page’);



4. Added this code to a JavaScript library and attached it to the “OnTabStateChange” event:

5. We repeated this for all the tabs with IFRAMEs which are custom and where delaying the load of the form and the ones which are not on the main tab of the form

On doing this, the performance change was drastic since the client had lots of tabs which contained more than one IFRAME. Way to go JoeCRM!

As always, we hope this tip helps you as you journey through the wonderful world of Microsoft Dynamics CRM. Feel free to contact the CRM Experts at Powerobjects if you need help with any projects related to Dynamics CRM.

Happy CRM’ing

Avatar for Joe D365

Joe D365

Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.