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
InternalServerErrorInternalServerError 

Remove Link from <apex:outputField >

I am displaying the name of the asset on a page like this <apex:outputField id="CaseField3" value="{!Case.AssetId}"/>.

 

This displays the name of the asset as a link since this is a lookup relationship, therefore, the user can click on it and is taken to the asset page. I would like to prevent that from happening, is there a way to remove the hyperlink and just display the name? or at least don't do anything if the user clicks on the link ?

 

 

Leon MorockiLeon Morocki

Does <apex:outputText value="{!Case.Asset.Name}"> work?

InternalServerErrorInternalServerError

Thanks but it doesn't display anything. I must add that this page is on the customer portal.

JHayes SDJHayes SD

Can you use the style attribute to remove the hyperlink?  Try this:

 

<apex:outputField id="CaseField3" value="{!Case.AssetId}" style="color:black;text-decoration:none;cursor:default" /> 

 

InternalServerErrorInternalServerError

Thanks. Unfortunately that didn't work. It stays the same.

PatcsPatcs

Hi

 

I am also facing the same problem, If you resolve this issue please let me know.. 

 

InternalServerErrorInternalServerError

 

I ended up retrieving the field using a different SOQL query. With that new query I was able to use OutputText insted and it worked fine. 

Abhishek Verma 34Abhishek Verma 34
@InternalServerError please provide the SOQL query you used .. thank you