Adding an IFrame to a dashboard

This recipe will show you how to add an IFrame to a system dashboard. We will be adding an IFrame that links to a free Microsoft FUSE Labs Social Gadget that displays a tag cloud for the key phrase Dynamics CRM.

Getting ready

There is a difference in how user and system dashboards work with IFrames (explained in the Restricting cross-frame scripting and User dashboards section), so for this recipe, we will create a new system dashboard. Navigate to the Customization section in the Dynamics CRM 2011 Settings area.

How to do it...

Carry out the following steps in order to complete this recipe:

  1. From the Customization section, click on the Customize the System link, as shown in the following screenshot:
    How to do it...
  2. This will launch the Solution Editor dialog showing the Default Solution for Dynamics CRM 2011. Click on the Dashboards link located in the left-hand navigation section, as shown in the following screenshot:
    How to do it...
  3. A listing of system dashboards will be shown. Click on the New button located in the list's toolbar. This will launch the Select Dashboard Layout screen.
  4. Select a 2-Column Regular Dashboard layout and click on the Create button. Provide a name, such as iFrame and WebResource dashboard. The IFrame and WebResource components will need lots of space, so I have adjusted the layout of my dashboard to only have one placeholder on each of the two rows. After you have adjusted the dashboard, click on the Save button, as shown in the following screenshot:
    How to do it...
  5. Click on the Insert IFrame icon located in the first component placeholder of the new dashboard. This will bring up the Add an IFRAME dialog:
    How to do it...
  6. The Name field will already be filled in with a system-generated value, so we only have to provide a value for the URL field. Add the following value to the URL field:

    http://embed.socialgadgets.fuselabs.com/Embed/A?keyword=Dynamics CRM&ts=ThreeDays&ver=1.0

  7. Next, make sure to uncheck the Restrict cross-frame scripting option located in the Security part of the dialog. A complete description of the option can be found later in this recipe. Click on the OK button to commit the changes:
    How to do it...
  8. Click on the Save and Close button on the dashboard editor ribbon bar. Select the new dashboard in the listing of system dashboards and click on the Publish button, as shown in the following screenshot:
    How to do it...
  9. In order to see the new dashboard with the IFrame component, navigate to the Workplace section of Dynamics CRM and select the new dashboard from the list of available dashboards:
How to do it...

Tip

HTTP and HTTPS: Why do I get a secure content warning?

In order to meet security requirements, Dynamics CRM Online is served by an HTTPS channel (the same as online banking applications are) and when we mix that HTTPS content with an IFrame that contains HTTP content, as in this example, the users will get a security warning regarding the use of mixed content. Avoiding this message is outside the scope of this book, but there are supported ways to avoid getting this message when using Dynamics CRM Online. Please check with your systems administrator for directions, as this will involve modifying the client's Internet Explorer security settings to allow mixed content. This may go against your organization's security profiles, so it will need to be discussed before making these changes to the client machines.

The following screenshot shows a secure content warning, which you may get:

How to do it...

There's more...

Adding an IFrame component can be done very quickly using the dashboard designer. This section will discuss the other properties available for you when adding IFrame components.

Displaying a label for the IFrame

One of the options in the IFrame component lets you specify and display a label for the IFrame component. When this option is set, the text label will appear in the upper-left corner of the IFrame component. Note that making a label appear may result in the IFrame content being be misaligned, so it is better to test this before deployment. You can see in the following screenshot that the bottom of our FuseLabs gadget now gets chopped off when we show a label for the IFrame component:

Displaying a label for the IFrame

Passing object-type and GUID parameters

If the IFrame component is designed to reference dynamic content that can accept and process parameters from the Dynamics CRM system, then checking the Pass record object-type code and unique identifier as parameters option will pass the following information:

Parameter

Name

Description

Notes

typename

Entity Name

The name of the entity type hosting the IFrame.

Value is not passed from dashboard IFrame.

type

Entity Type Code

Integer value that represents the entity type. Assume they are unique for each CRM organization.

Value is not passed from dashboard IFrame.

id

GUID

The GUID value for a record.

Value is not passed from dashboard IFrame.

orgname

Organization Name

The unique name for the CRM organization.

Value is passed.

userlcid

User Language Code

The language code of the current user.

Value is passed.

orglcid

Organization Language Code

The base language code for the CRM organization.

Value is passed

Restricting cross-frame scripting and User dashboards

When building a User dashboard and adding an IFrame component, the Restrict cross-frame scripting checkbox field is disabled. Due to the security openings that happen when cross-frame scripting is enabled, User dashboards are not allowed to use this feature. Without using cross-frame scripting the IFrame can make references to content that exists on the same domain, but nothing outside the domain that may request information from the originator, such as reading the base URL.

The following link takes you to the Microsoft MSDN library to provide more information on cross-frame scripting and potential security concerns:

http://msdn.microsoft.com/en-us/library/ms533028(v=VS.85).aspx

The following screenshot shows a message that may appear when cross-frame scripting is being restricted:

Restricting cross-frame scripting and User dashboards
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.10.201