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

Comments (6)

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

  2. fadam says:

    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.

  3. dbenton says:

    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);

  4. dbenton says:

    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=&quot;;

       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;

    }

  5. Marie Jordan says:

    I am looking for a very good highly paying job in production . I have seventeen years of production experience. I live in Tuscaloosa . My no. is (2050496-4522 thank you linkedin .com. My email is mj92307@gmail . com and tonycarter1974@yahoo.com

Skip to main content