I am trying to generate the dynamic URL to redirect to record but it appends the id to the current page.

For example, I am getting--> https://nishant-aishwarya-1234-dev-ed.lightning.force.com/lightning/page/0062w000003ar1dAAA/view

What I want--> https://nishant-aishwarya-1234-dev-ed.lightning.force.com/lightning/r/Opportunity/0062w000003ar1dAAA/view

This is the code to my render function-->

            columns.push({data: columnNames[i], 
            title: columnNames[i],
            render: function(data, type, row, meta){
            data = '<a href=' + row['id'] + '/view'+'>' + data + '</a>';
            return data;


The following code worked for me,

 data = '<a href="/lightning/r/Opportunity/' + row['id'] + '/view" target = _blank>' + data + '</a>';
  return data;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.