I have a Lightning Component in my Home page that filter a list of Opportunities. On the title I have a link to the list on the Opportunity tab that works perfectly. enter image description here This is the code.

<a href="/one/one.app?#/sObject/Opportunity/list?filterName=00B28000000zx7MEAQ" target="_blank" class="slds-type-focus">
<span class="slds-section__title">My Policies due to Renewal</span></a> 

I tried to create a similar link on the Opportunity Name to open the record detail page with no success. My code is:

<a href="{!'/one/one.app?#/sObject/'+ opp.Id}" target="_blank">{! opp.Name }</a>

I got the error message

"This page isn't available in Salesforce Lightning Experience or Salesforce1". The address in the URL is : /one/one.app?#/sObject/006280000074WXdAAM and it should be : /one/one.app?#/sObject/006280000074WXdAAM/view?t=1478147610998

How can I get the view part?

2 Answers 2


Just append view text to the end of href of the anchor tag.

 <a href="{!'/one/one.app?#/sObject/'+ opp.Id + '/view'}" target="_blank">{! opp.Name }</a>
  • I would like to use as target "_blank", but it generates error to me. There is any alternative option to refresh the page and not to open a new tab?
    – Klodj_Meta
    Commented Mar 9, 2017 at 18:01
  • Can you open a new question and link to this answer with details of error you are getting?
    – Praveen
    Commented Mar 10, 2017 at 3:36
  • @Praveen Do you have any idea about link to a record edit page? I tried appending /edit. It works but when clicked on save it does not navigate to view instead to comes back to edit page.
    – snehakem
    Commented Sep 8, 2017 at 13:56
  • @snehakem Somewhere internally the return url is sent behind the scene.At the moment I don't have a solution for your problem.
    – Praveen
    Commented Sep 11, 2017 at 7:59
  • Thanks for you response @Praveen. I will figure out some other way.
    – snehakem
    Commented Sep 12, 2017 at 9:56

Here's a better answer written for LWC, but can also be used in an aura component.

First, create a URL in your javascript - either attached to the app object or as it's own component attribute. The trick here is that the url resolves simply to your salesforce instance url with the ID appended to the end. Salesforce will redirect you to the record page automatically.

url = '/' + app.Id;

then use the url in your markup...

<a href={app.Id} target="_blank"></a>

You must log in to answer this question.

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