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)

Reference field in HTML Web Resource to create URL

(0) ShareShare
ReportReport
Posted on by

Just starting out and not a programmer.

I have a linkedin reference on my contact form and a URL in the field "gvd_linkedin"

My web resource includes the following script from the linkedin site.

<html>

<head><script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<meta charset="utf-8"></head>

<body><script type="IN/MemberProfile" data-format="inline" data-id=https://www.linkedin.com/in/myprofile></script></script></body>

</html>

Whilst this works fine for showing my profile I want to replace the url with the field "gvd_linkedin" from the contact form.

Cheers.

*This post is locked for comments

I have the same question (0)
  • Aileen Gusni Profile Picture
    44,524 on at
  • Community Member Profile Picture
    on at

    Thanks for the pointers. Nearly there I believe.

    data-id=???? What I have does not work. I need to reference the var linkedinContact

    <html><head>
    <script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
    <script type="text/javascript">
    function createUrl() {
    var linkedinContact = Xrm.Page.data.entity.attributes.get(“gvd_linkedin”).getValue();
    }
    </script>
    <meta charset="utf-8">
    </head>

    <body onload="createUrl()">
    <script type="IN/MemberProfile" data-id=linkedinContact></script>

    </body></html>

  • Mahadeo Matre Profile Picture
    17,021 on at

    hi Elderor,

    I modified your code.. try this.

    <html>

    <head>

       <script src="platform.linkedin.com/in.js&quot; type="text/javascript"></script>

       <script type="text/javascript">

           function createUrl() {

               var linkedinContact = Xrm.Page.data.entity.attributes.get('gvd_linkedin').getValue();

               var memberscrpt = document.getElementById('memberScript');

               memberscrpt.setAttribute("data-id", linkedinContact);

           }

    </script>

       <meta charset="utf-8">

    </head>

    <body onload="createUrl()">

       <script id="memberScript" type="IN/MemberProfile" data-id="www.linkedin.com/.../&quot;></script>

    </body>

    </html>

    Hope this will solve your problem.

  • Verified answer
    Community Member Profile Picture
    on at

    Thanks Mahadeo, Unfortunately this did not work for me.

    I ended up getting salesmetrix.com code to work in CRM 2015 as follows.

    Where new_linkedin is my field name which contains the full public url from linkedin for each contact and is on the form, and api_key is my own as retrieved from www.bingmapsportal.com

    <html><head>

     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>

     <script src="platform.linkedin.com/in.js&quot; type="text/javascript">

      // api_key: xxxxxxxxxxxxxxxxxx

       </script>

     <meta charset="utf-8">

    </head>

    <body>

     <script type="text/jscript">

      try {

       // Retrieve the profile url form dynamics field

       var linkedprofilelink = window.parent.Xrm.Page.getAttribute("new_linkedin").getValue();

        if (linkedprofilelink != null) {

         // Load the profile

        newmemberprofile(linkedprofilelink);

       }

      }

      catch (e) {

        alert(e.message);

      }

      function newmemberprofile(id) {

       // Create the script tag

       var $s = $('<script/>');

       // Assign the attributes

       $s.attr({

        'type': 'IN/MemberProfile',

        'data-id': id,

        'data-related': 'false',

        'data-format': 'inline',

        'data-width': '350px'

       });

       // Inject the tag

       $('body').append($s);

      }

     </script>

    </body></html>

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