Hi,
I'm trying to build a link from a column in an Entitylist to redirect to a webform from a related entity. The javascript I'm trying to use is based on that posted here, but isn't working for me in the way that I want: https://community.dynamics.com/crm/b/thinkdynamicdodynamic/posts/crm-portals-add-hyperlink-on-custom-attribute-in-entity-list.
The javascript I've put together is as follows:
$(".entitylist").on("loaded", function () {
//To make the other field/column's value hyperlink
$("td[data-attribute*='xxxx_publishingreference']").each(function() {
var id=$(this).attr("data-value");
// Partial URL of webpage where you want to redirect the user or the page from which your Edit Entity Form is associated
var pagewhereToRedirect = "reports";
// 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>");
});
});
Unfortunately the "data-value" pulls back the following detail: data-value="{"Id":"85030da1-3b03-eb11-a813-000d3a7ed2f2","LogicalName":"xxxx_onlinedecisions","Name":"P-001009","KeyAttributes":[],"RowVersion":null,"ExtensionData":null}"
All I want is to get just the "Id" part of the string. I've tried a JSON parse, but this didn't work (although I may have used it wrong).
Any ideas?
Cheers
Ralph