Welcome to MSDN Blogs Sign in | Join | Help

Microsoft Dynamics CRM Online Team Blog

This blog is focused on Microsoft Dynamics CRM Online (crm.dynamics.com).

News

  • The views expressed in this blog are those of the individual and do not necessarily represent those of Microsoft. This information is provided by way of general information only and should not be relied on without obtaining independent expert advice. These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.
Adding LinkedIn Contact Searches

LinkedIn is fairly popular business networking tool that allows you make connections and take advantage of relationships based on those connections. You can send messages and request to many connections. Since these relationships exist across multiple companies with individuals you’ve never had contact with, they provide you with a market to search for new customers, new employers/employees, and new business partners. Since you probably have lots of your contacts in your CRM system, its likely you might want to add them as LinkedIn Contacts. Doing so will give you the view into other relationships they might have as well as you can make a connection to them that will extend past your CRM.

Microsoft Dynamics CRM allows you to do various customizations to the existing application. One type customization is to modify the user interface. I’ve added a button to the contact forms that will open up Linked In and auto search for your contacts name. Notice also you could do this on a Tab with an IFrame if you prefer. In that case, you would set the jscript to dynamically specify the IFrame URL in the form load event.

team1

When you click on the button, it will launch the Linked in public search with the contacts first and last name.

 team1

To add the button you will need to modify the ISV configuration xml. We’ll need to add some jscript to construct the LinkedIn url using the first name and last name of the contact.

The public search url is    http://www.linkedin.com/pub/dir/?last=White&first=Jon . If you already a member you can use the more advanced search,
http://www.linkedin.com/search?pplSearchOrigin=GLHD&keywords=jon+white&search=.  

I’ll show you the script for the public search.

Let’s look at the javascript first.

var first='&first=';
var FName= crmForm.firstname.DataValue;
var LName = crmForm.lastname.DataValue;
var LinkUrl='http://www.linkedin.com/pub/dir/?last=';
LinkUrl+=LName;
LinkUrl+=first;
LinkUrl+=FName;
window.open(LinkUrl);

Notice we are using the CRM document object model to grab fields off the form. Next we need to add to the ISV Config settings.

The first step here is to export your ISV XML.

team1

After you export the file, open it up and edit the xml. To add a button to the contact toolbar, you need to edit the Contact element and add the Button element to it. See below.

<Entity name="contact">

          <ToolBar ValidForCreate="0" ValidForUpdate="1">

            <Button Icon="/_imgs/ico_18_debug.gif"

                    JavaScript="var first='&amp;first=';var FName= crmForm.firstname.DataValue;var LName = crmForm.lastname.DataValue;var LinkUrl='http://www.linkedin.com/pub/dir/?last=';LinkUrl+=LName;LinkUrl+=first;LinkUrl+=FName;window.open(LinkUrl);">

            <Titles>

                <Title LCID="1033" Text="Search Linked In" />

              </Titles>

              <ToolTips>

                <ToolTip LCID="1033" Text="Search Linked In." />

              </ToolTips>

            </Button>

          </ToolBar>

        </Entity>   

Keep a back up of you original in case you make a mistake.

Next you’ll just need to import the changes. That’s it. Now you can start using LinkedIn to search for you Dynamics CRM contacts.

See the software development kit for further details

Microsoft Dynamics CRM SDK Download

-cheers
jow

Posted: Tuesday, April 07, 2009 7:02 PM by JonWhite
Filed under: ,

Comments

Microsoft Dynamics CRM Online Team Blog said:

LinkedIn is fairly popular business networking tool that allows you make connections and take advantage

# April 8, 2009 2:11 AM

fadam said:

Exported the ISV config but there is no Contact Element.  We are vanilla at this point so I have little context as to where to place your script.

# April 24, 2009 1:54 PM

dbenton said:

Hi, Thanks for a great start!

I'm trying to narrow the result set by search current and past companies. I have the below working except for the crmForm.parentcustomerid.DataValue. The result appears to be the ID (not surprised) instead of the actual name. How do I get the company name so I can insert it into the search string?

Any help is greatly appreciated!

var last='&amp;lname=';

var first='&amp;fname=';

var cpsearchtype='&amp;currentCompany=cp';

var company='&amp;company=';

var FName= crmForm.firstname.DataValue;

var LName = crmForm.lastname.DataValue;

var Employer = crmForm.parentcustomerid.DataValue;

var LinkUrl='http://www.linkedin.com/search?search=';

LinkUrl+=last;

LinkUrl+=LName;

LinkUrl+=first;

LinkUrl+=FName;

LinkUrl+=cpsearchtype;

LinkUrl+=company;

LinkUrl+=Employer;

window.open(LinkUrl);

# May 11, 2009 8:24 PM

dbenton said:

Hi,

I found this works better in the OnLoad event of the form.

linkedinUrl = function ()

{

   var ParentAccountValue = new Array();

   var url = "http://www.linkedin.com/search?search=";

   ParentAccountValue = crmForm.all.parentcustomerid.DataValue;  

   if (ParentAccountValue != undefined) {

       //Treat the lookup object as an array with the following properties: id, name, type, typename        

       url = url + "&amp;lname=" + crmForm.all.lastname.DataValue;

       url = url + "&amp;fname=" + crmForm.all.firstname.DataValue;

       url = url + "&amp;currentCompany=cp&amp;company=" + ParentAccountValue[0].name

   }

   else {

       //This won't prevent the user from accessing the site, but let's them know that the search will be more

       //meaningful with a Parent Account specified

       alert('You should have a Parent Account selected before performing this search!');

       url = url + "&amp;lname=" + crmForm.all.lastname.DataValue;

       url = url + "&amp;fname=" + crmForm.all.firstname.DataValue;        

   }

//     'width=450px,height=500px,menubar=no,status=no,toolbar=no'

   window.open(url);

   return;

}

# May 27, 2009 1:41 PM
Anonymous comments are disabled
Page view tracker