0

I am new to Salesforce Lightning and I would like to make a table that has values that I could click on, and open the object details in another tab.

In salesforce Classic, I did this way:

<apex:column headerValue="{!$ObjectType.Address__c.Fields.ConectionObject__c.Label}"> 
    <apex:outputLink value="{!URLFOR($Action.Connection_Object__c.View, item.ConectionObject__c)}">{!item.ConectionObject__r.Name}</apex:outputLink>
</apex:column>

And at the moment, my code is the next one:

<td>
    <div class="slds-truncate" title="{!dir.ConectionObject__c}">{!dir.ConectionObject__r.Name}
    </div>
</td>

But I don't know how to make it navigable (I guess that is using a kind of link) I have checked to ui:outputURL or to ui:inputURL but I don't know how they work.

Cheers

  • Can you try <a href="{!'/one/one.app?#/sObject/'+ dir.ConectionObject__c + '/view'}" target="_blank">{!dir.ConectionObject__r.Name}</a> – Tushar Sharma Mar 15 '18 at 11:49
  • Then you can accept this answer and close this question. – Tushar Sharma Mar 15 '18 at 12:24
  • I would not hardcode /one/one.app in the link as url format will change in Summer '18: help.salesforce.com/… – Fabien Taillon Mar 15 '18 at 12:48
0

You can try basic anchor tag to achieve this.

<a href="{!'/one/one.app?#/sObject/'+ dir.ConectionObject__c + '/view'}" target="_blank">{!dir.ConectionObject__r.Name}</a>

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.