Adding a LinkedIn Gadget to the Person Summary Screen

Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.

Adding a LinkedIn Gadget to the Person Summary Screen

  • Comments 10
  • Likes

LinkedIn is one of the most popular Social Media networks and is highly relevant to the business community.   Sage CRM offers within the Interactive Dashboard the ability to research contacts directly in the LinkedIn community.  Please see the article "Using Sage CRM to make LinkedIn work for you" for more details.

LinkedIn provides a number of different tools and resources for developers to be able to include LinkedIn features into websites.  LinkedIn calls these either 'Plugins' or APIs.

Sage CRM offers very easy hooks for you to use the LinkedIn Plugins and APIs within its screens.  The Plugins provide the easiest way of doing this.  Below you can see how I have included a Plugin that will pop up the Contacts details, including their Photo on the screen.  The way this behaves depends on whether you have signed in to LinkedIn or not and draws its data from the contacts public LinkedIn profile.

The code that will call the LinkedIn Plugin is added to the create script of the pers_lastname field in the PersonBoxLong screen.

[code language="javascript"]
Caption = CRM.GetTrans("colnames","pers_lastname")+":";
var strLinkedInProfile = Values("pers_linkedinpublicprofile");
if ((Values("act")==220 || Values("act")==222 || Values("act")==520) && strLinkedInProfile)
{
var strProfileBadge = "<script src='http://platform.linkedin.com/in.js' type='text/javascript'></SCRIPT>";
strProfileBadge +="<script type='IN/MemberProfile' data-id='"+strLinkedInProfile+"' data-format='hover'></SCRIPT>"
Caption += strProfileBadge;
}
[/code] 

Note:  

  1. The Public LinkedIn Profile is held in a new field on the Person entity called  pers_linkedinpublicprofile.  This will be in the form of 
    1. http://www.linkedin.com/pub/simon-yaltoy/16/771/33a
    2. http://www.linkedin.com/in/jtcrichards
  2. To be able to use the full capability of LinkedIn In a full production system you would need to use either the LinkedIn Javascript or REST API.  

Comments
  • Hi Jeff

    Just tried this and I get: pers_lastname jscript error: Expected ']' Line: 2 Char: 6

    Any ides as script looks as above?

    Thanks

  • Hi Jeff/RBC, did you ever find a resolution to the Jscript error?

  • jeff this works great, have you done this similarly for the company using linkedin plugins?

  • never mind got it working with the companyprofile plugin using the script available at developer.linkedin.com/.../company-profile

  • this was my code and the linkedin icon appears for the company profile but on hover nothing happens any suggestions

    Caption = CRM.GetTrans("colnames","comp_name")+":";

    var strLinkedInProfile = Values("comp_linkedinprofile");

    if ((Values("act")==200 || Values("act")==201 || Values("act")==520) && strLinkedInProfile)

    {

    var strProfileBadge = "";

    strProfileBadge +=""

    Caption += strProfileBadge;

    }

  • I added the field called comp_linkedinprofile in the company entity, used the IN/CompanyProfile option

    Caption = CRM.GetTrans("colnames","comp_name")+":";

    var strLinkedInProfile = Values("comp_linkedinprofile");

    if ((Values("act")==200 || Values("act")==201 || Values("act")==520) && strLinkedInProfile)

    {

    var strProfileBadge = "";

    strProfileBadge +=""

    Caption += strProfileBadge;

    }

    end up with the linkedin icon appearing but on hover it just does not display the linkedin profile of the company

  • i am not sure if company profile plugin of linkedin works any more, but tried the company insider as well doesnt work

    Company Insider in Sage CRM

    <!--

    Caption = CRM.GetTrans("colnames","comp_name")+":";

    var strLinkedInProfile = Values("comp_linkedinprofile");

    if ((Values("act")==200 || Values("act")==201 || Values("act")==520) && strLinkedInProfile)

    {

    var strProfileBadge = "<script src='platform.linkedin.com/in.js& type='text/javascript'></SCRIPT>";

    strProfileBadge +="<script type='IN/CompanyInsider' data-id='"+strLinkedInProfile+"'></SCRIPT>"

    Caption += strProfileBadge;

    }

    -->

  • I've just tried the Member Profile and this works.

    LinkedIn may change their scripts from time to time and we are not in control of how these scripts work.

  • For the member profile Jeff, did you copy the LinkedIn plugin and paste it into your Script above anywhere? I can get my profile to appear on every contact from the LinkedIn Plugin, but clearly that is not what we want to achieve.

    Simply using copy & paste on the script above into create script causes the warning message "pers_lastname jscript error: Expected ']' Line: 2 Char: 6" to appear.

    Just a little bit of extra information here would be appreciated.

  • DarrenA, what version of Sage CRM are you using?

    Try the following code in the person last name Create Script field.

    Caption = CRM.GetTrans("colnames","pers_lastname")+":";

    var strLinkedInProfile = Values("pers_linkedinpublicprofile");

    if ((Values("act")==220 || Values("act")==222 || Values("act")==520) && strLinkedInProfile)

    {

    var strProfileBadge = "";

    strProfileBadge +="";

    Caption += strProfileBadge;

    }

    You need to be careful as when saved the end  will be changed to  which then when you try to save will just return 3 fields on the CRM screen. You will need to make sure each time you amend the screen the code is changed back.

    You could however place it into a js file in the custom folder and call it from there instead.