You need to sign in to do that
Don't have an account?
Baylor Peak 2
Trying to make ID URL to link to the record via Aura Component?
Hello all.
I have an Aura Component that I want to make Fields linkable using 'url' via Javascript.
This is what I have so far:
({ myAction : function(component, event, helper) { component.set("v.Columns", [ {label:"Record ID", fieldName:"ID", type:"url", typeAttributes: { label: {fieldName: "ID"}, target: '_self' }, sortable: true }, {label:"First Name", fieldName:"FirstName", type:"text"}, {label:"Last Name", fieldName:"LastName", type:"text"}, {label:"Phone", fieldName:"Phone", type:"phone"} ]); var action = component.get("c.getContacts"); action.setParams({ recordId: component.get("v.recordId") }); action.setCallback(this, function(data) { var contacts = data.getReturnValue(); contacts.forEach(function(item) { item['URL'] = '/lightning/r/Contact/' + item['Id'] + '/view'; }); component.set("v.Contacts", contacts); }); $A.enqueueAction(action); } })
I want the Record ID column to display the Contact ID and make that clickable so it takes you directly to the Contact record.
What am I missing please?
Try this code
Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.
Thanks and Regards