Skip to main content

Notifications

Announcements

No record found.

CRM Portals - Add Hyperlink On Custom Attribute In Entity List

Arpit Shrivastava Profile Picture Arpit Shrivastava 7,518 User Group Leader











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+"</a>");

});

});


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










This was originally posted here.

Comments

*This post is locked for comments