0

I am a new Salesforce Admin and we are currently setting up our account. We are currently capturing a leads LinkedIn profile URL on our leads. I wanted to display the users linked in profile via an iframe directly on the lead page. Whats the best way to go about this, the profile URL is collected as a field so I would think you could make some script that would pull that data from the field and render the webpage in an iframe.

Any help would be appreciated!

Thanks!

1 Answer 1

3

All you need to do is to create a Visualforce page and drop it in wherever you'd like. Here's an example:

<apex:page standardController="Lead">
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/MemberProfile" data-id="https://www.linkedin.com/in/{!Lead.LinkedInId__c}" data-format="inline" data-related="false"></script>
</apex:page>

Do this, then edit the Lead page layout and drop it in somewhere, and you'll get to see the LinkedIn embedded API.

Or, if you want to actually show the profile, you could do that, too, by a similar technique:

<apex:page standardController="Lead">
<iframe src="https://www.linkedin.com/in/{!Lead.LinkedInId__c}" />
</apex:page>

You'll want to adjust the code to get the experience that you want.

Note: Some sources state that you can't iframe a LinkedIn member page, so this second technique may not work. I've used the first method successfully in the past, though, so that should be fine.

You can read a bit more about adding Visualforce to a standard page layout in this trailhead unit or in the documentation.

As a related note, there is a Profile API that you can use as another alternative, allowing you to query the data from the profile and you could render the results yourself. Again, this can be done in Visualforce.

3
  • Awesome! This make perfect sense, since I have the full url and not just the LinkedInID can I do this instead? <apex:page standardController="Lead"> <script src="//platform.linkedin.com/in.js" type="text/javascript"></script> <script type="IN/MemberProfile" data-id="{!Lead.LinkedInURL__c}" data-format="inline" data-related="false"></script> </apex:page> Commented May 16, 2018 at 23:27
  • @NateHarris Yes, just saw your edit, that should also work just fine.
    – sfdcfox
    Commented May 16, 2018 at 23:28
  • Just wanted to update that your first example worked! I used the second one and can confirm the iframe would not render. Thank you for your help! Commented May 17, 2018 at 18:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .