Tuesday, July 8, 2008

Integrating LinkedIn and MS-CRM



A simple example of using a dynamic URL to pull LinkedIn information into a MS-CRM iframe.



For this example we will create a simple integration with LinkedIn from the MS-CRM account record. This integration will allow CRM users to quickly see all contacts from this account that are in their LinkedIn network. This feature is enhanced significantly if you setup a group for your Organization within LinkedIn, because this will ensure you see all of the relationships across your organization.




1) Create the iFrame
As a system administrator, go to the Settings tab and click Customizations. Select Customize Entities and then click the Account record. Click Forms and Views under the details section. Click the form record. Add a Tab and name it LinkedIn. Add a section and name it LinkedIn. Add an Iframe and name it IFRAME_LinkedIn. Uncheck restrict cross-frame scripting box and check the “automatically expand to use available space” box under the row layout section of the formatting tab. Click ok to save the iframe changes.

2) Add Code
Click the form properties under the common tasks section of the account form. Select OnLoad from the Event List and click edit. Enter the following code:



var CRM_FORM_TYPE_CREATE = 1;
var CRM_FORM_TYPE_UPDATE = 2;
switch (crmForm.FormType)
{
case CRM_FORM_TYPE_UPDATE:
crmForm.all.IFRAME_LinkedIn.src="http://www.linkedin.com/search?search=&company=" + crmForm.all.name.DataValue+ "&currentCompany=currentCompany&searchLocationType=I&countryCode=us&postalCode=" + crmForm.all.address1_postalcode.DataValue+ "&distance=50&sortCriteria=3";
break;
}



Click ok to close Event Detail Properties window. Click ok to close Form Properties window. Click the Save and Close button on the Account form.

3) Publish
Click Publish from the Action menu on the Account Entity form. The change is now available to your application.







Notes
Required Fields
Account Name and Zipcode are required fields for this integration and should be made as required fields in MS-CRM. The Zipcode requirement can be removed by removing the location references in the URL.

Sorting
The lists will be sorted by the default sorting (degrees and Name). This can be changed by changing the sortCriteria value.
1: Number of Connections
2: Degrees and Recommendations
3: Degrees and Name
4: Keyword (CompanyName) relevance

Troubleshooting
If you get a security message when you open the account record or the following message in the LinkedIn iframe “Navigation to the webpage was canceled”, you need to change security settings in Internet Explorer to enable “Display Mixed Content”.

6 comments:

Unknown said...

This is pretty smooth... however, when I do so, I get a LinkedIn sign-on screen when I click on the tab. Will all my users have to log in to Linked In everytime?

Thanks for this great piece of information.
trovilaluce@gmail.com

Ted Battreall said...

The simple solution (although not the most secure) is to have your browser remember your LinkedIn password. That way they can get into Linked in through MS-CRM without logging in. Most users do this anyway so they don't have to log in everytime they need to hit a LinkedIn page.

Ted Battreall said...

Another approach is to create a seperate webpage that calls the linkedin api directly: http://blogs.msdn.com/crm/archive/2008/07/16/linkedin-to-microsoft-dynamics-crm.aspx

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

Unknown said...

Thanks for this description; however, I am experiencing an issue. In your description to add the iFrame Properties there was not information pertaining to the URL. I tried adding generic options like “/ISV/linkedin.html” (this type of fix as worked in the past), but I could not get it to work. Please advise as to what I should be putting into the URL field on the iFrame properities to allow it to work with the code added to the Form Properties.

Thanks!

Daniel said...

@Stephanie, do you have the linkedin.html in your ISV folder? Also, you may want to verify that the Pass record object-type code and unique identifier as parameters is checked and that restrict cross-frame scripting is unchecked.