CRM Portals – Add Hyperlink On Custom Attribute In Entity List












By default, In Entity List If you enable settings to view Entity List records, It shows hyperlink only on very First Column of Entity List.

Refer below link to configure Details View Setting (to view entity list record) in Entity List.

https://community.adxstudio.com/products/adxstudio-portals/documentation/configuration-guide/entity-list/view-details-page/

https://community.dynamics.com/crm/b/nishantranaweblog/archive/2017/02/02/using-entity-list-to-show-crm-data-in-portal-in-dynamics-365



For Example – In above example, I have exposed Case Entity List on Portal, It showing hyperlink on only Case Number, But If I want to make the hyperlink on any other Field it is not possible Out of Box.

So In this article, I will walk you through the way to make the other Column Value Hyperlink of any Entity List in Portal.

Code Snippet:


$(\’.entitylist\’).on(\”loaded\”, function () {

//To make the other field/column\’s value hyperlink
$(\”td[data-attribute*=\’Field\’s SCHEMA NAME or Field\’s HTML Control Id\’]\”).each(function() {

// For Example
$(\”td[data-attribute*=\’title\’]\”).each(function() {

// Get guid of record – might need to change this line a bit to get the record guid
var id=$(this).closest(\’tr\’).attr(\”data-id\”);

// Partial URL of webpage where you want to redirect the user or the page from which your Edit Entity Form is associated
var pagewhereToRedirect = \”Web page Partial URL\”;

var pagewhereToRedirect = \”edit-case\”; // For Example

// Construct the URL
var redirect=window.location.href+pagewhereToRedirect+\”/?id=\”+id;

// Make the field value Hyperlink
var text=$(this).text();

$(this).html(\”<a href="+redirect+\”>\”+text+\”\”);

});

});

Note: In above code, you just need to change the highlighted value only.

To get Field\’s SCHEMA NAME or Field\’s HTML Control Id

Press F12 or Right Click  >  Inspect





















To get Web page Partial URL

Right Click on Hyperlink and Copy Link Address. The highlighted part is the partial URL of the webpage.

https://arpitdynamics.microsoftcrmportals.com/support/edit-case/?id=2c29a2bb-bb01-e811-90cd-0003ff913670








Published by arpitpowerguide

My name is Arpit Shrivastava, who is a Microsoft MVP in the Business Applications category. I am a Microsoft Dynamics 365 and Power Platform enthusiast person who is having a passion for researching and learning new things and acquiring immense knowledge. I am providing consistent help, support, and sharing my knowledge through various Social Media Channels along with my Personal Blog, Microsoft Community, conducting online training and attending various 365 Saturday Events worldwide and sharing the best Solutions to the readers helping them achieve their goals and objectives in Customer Relationship Space.

7 thoughts on “CRM Portals – Add Hyperlink On Custom Attribute In Entity List

  1. I am trying to hyperlink email which is one of the attribute in the entity list. Is this possible using the same code above?I have tried to this under Entity List> JS

    Like

  2. Great Post and is really helpful. I just have a question, could you assist me in rather redirecting to a different page maybe open up a modal dialog screen so that you don't have to loose focus from the page you are on?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: