just coding...

Show navigation bar item in IFrame in Microsoft CRM

Show navigation bar item in IFrame in Microsoft CRM

We don't make anything without Navigation Bar in CRM. In default, CRM haven't a setting about showing their pages in a IFrame. But we can change this event and we can more effective a usage area in CRM Form. Specially sales persons don't want to click to lot of things and they want see the result of an action. So in this article we will learn how to show associated activities in centre of Contact card. We have a way that have two step. In first step, we will place a IFrame in Contact Card. In second step we will place a little JavaScript code for IFrame that we had placed. Let start;

a) IFrame :

"Settings" -> "Customizations" -> "Customize Entities" after this steps in CRM, we find the Contact card and we open this card. We select the "Forms and Views" in navigation bar at left and we clicked the Form.
Where you want place the your activities screen you select the interested tab and click the "Add IFrame" button. A window will be opened;

  1. set the Name "HistoryFrame",
  2. set the URL "about:blank",
  3. we select the "Pass record object-type code and unique identifier as parameters",
  4. we unselect the "Restrict cross-frame scripting"

The first step will be completed when we press the ok. Let the show second step;

b) JavaScript :

We click the "Form Properties" in same screen. We click the "OnLoad" on opened window. We replace the code that below. We click the buttons "ok" and "Save Form and Close".

function GetFrameSource(tabSet)
if (crmForm.ObjectId != null)
var oId = crmForm.ObjectId;
var oType = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
return "areas.aspx?oId=" + oId + "&oType=" + oType + "&security=" + security + "&tabSet=" + tabSet;
return "about:blank";

crmForm.all.IFRAME_HistoryFrame.src = GetFrameSource(

We click to "Publish" that in the "actions" menu. We will see the activity history of contact when we open a contact card.

I hope it will done. Regards.

Software Specialist