function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Varun AnnadataVarun Annadata 

Apex:outputlink is displaying id in vf page

I am using following code of Attachment object in vf page
<td><apex:outputLink value="/{!N.OwnerId}" target="_blank">{!N.OwnerId}</apex:outputLink></td>

when displaying {!N.OwnerId} on actual page id is displayed.How can i display name instead

I can use apex:outputField but i am not able to give target="_blank" so the page is being refreshed in vf page section without being displayed in new window.Any suggestion for solving the problem?
Best Answer chosen by Varun Annadata
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Varun,

May I suggest you Please refer the below link for reference. Hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar

All Answers

Devanshu soodDevanshu sood

Replace {!N.OwnerId} with {!N.OwnerId.name}

mark it as best answer if it helps you 

Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Varun,

May I suggest you Please refer the below link for reference. Hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar
This was selected as the best answer
Waqar Hussain SFWaqar Hussain SF
<td><apex:outputLink value="/{!N.OwnerId}" target="_blank">{!N.Owner.Name}</apex:outputLink></td>

ON the controller add owner.Name in you soql query.
For example 
 
Account acc = [Select OwnerId, Owner.Name from Account];

Let me know, If you have any questions.
Varun AnnadataVarun Annadata
Thank you guys.I solved it