0

I am seeing many examples of adding hyperlink in the data table. But i want to display a hyperlink as a heading. showing the transactionId as hyperlink and when clicked on it, it should take to that transaction record page. Tried using lightning-formatted-url but it asks for exact url to redirect. Instead of adding the url into the columns like this

 const COLUMNS = [
            {label:'Account Name', fieldName: 'Name',
    type: "url",
    typeAttributes: { label: { fieldName: "Id" }, target: "_top" },
    cellAttributes:{ 
        class:{fieldName:'accountColor'},
    }},

how can i add it directly ?

1 Answer 1

-1

You can use the below code on click of link : window.open(window.location.origin + "/" + recordId)

You must log in to answer this question.

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