Integrating CRM Accounts with LinkedIn is a very easy step. I have found numerous examples on doing this by using a Web Resource, but I don’t like the way it displays in a frame. It looks anything but professional.

So I decided there’s got to be a better way of doing this.

First off, I am using the jQuery library, so you will need to add that to your resources. It will make it so much easier to select elements on the page.

I have added an on load function to the account:

function Account_onLoad()
{
    var nvs_AccountName = Xrm.Page.getAttribute("name").getValue();
   
    $("#name").after(function() {
        var script = ‘<script src="
http://platform.linkedin.com/in.js" type="text/javascript"></script>’ +
        ‘<script type="IN/CompanyProfile" data-id="’ + nvs_AccountName +
        ‘" data-format="inline" data-related="false"></script>’;
        return script;
    });
}

I am looking for the Account name, as populated in the Name field, and retrieving the LinkedIn profile based on that. I have re-arranged the form to provide the space for the section that will be inserted right below the Account Name field:

image

In the Form Properties, add your references as below:

image

once you have all that set up, try opening an account, and you will get the following view:

image

No more iFrames, it just looks like it belongs there.

The beauty of this approach is also the fact that, if an account is not found on LinkedIn, no problem, the screen will look like so:

image

NOTE: Please be aware that you will get the following prompt:

image

Add LinkedIn to your browser’s trusted sites. In the Trusted Sites configuration, click on Custom level.

image

Set Display Mixed Content to Enable.

image

This setting can be pushed through a group policy. For more details see KB2625928.

Enjoy!

Advertisements