web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Web Resource Code for LinkedIn Company Profile

(0) ShareShare
ReportReport
Posted on by

This is the code I modified for a web resource that reads the LinkedIn Company Profile number from a custom field in Dynamics CRM. I used this to load the profile badge onto the account form.

<html>
 <head>
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
  <script src="https://platform.linkedin.com/in.js" type="text/javascript"></script>
  <meta charset="utf-8">
 </head>

 <body style="word-wrap: break-word;">
  <script type="text/jscript">
   try {
    // Retrieve the profile id from Dynamics CRM
    var linkedprofilelink = window.parent.Xrm.Page.getAttribute("mge_linkedin").getValue();
     if (linkedprofilelink != null) {
    // Load the profile including url prefix for company
     newcompanyprofile("http://www.linkedin.com/company/" + linkedprofilelink);
    }
   }
   catch (e) {
     alert(e.message);
   }
   function newcompanyprofile(id) {
    // Create the script tag
    var $s = $('<script/>');
    // Assign the attributes
    $s.attr({
     'type': 'IN/CompanyProfile',
     'data-id': id,
     'data-related': 'false',
     'data-format': 'inline',
     'data-width': '350px'
    });
    // Inject the tag
    $('body').append($s);
   }
    </script>
 </body>
</html>


*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Replace custom field 'mge_linkedin' with your own custom field name. Insert the web resource into your form and away you go. The custom filed should contain the company profile id number.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans