You need to sign in to do that
Don't have an account?

Make a link not a link!
I have a search page for my custom object and in the result display the Member field (linked to Contact) is automatically clickable. I don't want this to be the case. Can I disable this?
The code for the section is:
<apex:column >
<apex:facet name="header">
<apex:commandLink value="Member" action="{!toggleSort}" rerender="results,debug">
<apex:param name="sortField" value="member" assignTo="{!sortField}"/>
</apex:commandLink>
</apex:facet>
<apex:outputField value="{!counselling_practice.Member__c}"/>
</apex:column>
Thanks in advance
Justyn
In your apex controller instead of retrieving Counselling_Practice__c.Member__c field retrieve "Counselling_Practice__c.Member__r .Name" in your SOQL
All Answers
Are you referring to this?
<apex:outputField value="{!counselling_practice.Member__c}"/>
If so, have you trying apex:outputText?
Hi
Thanks for the suggestion. If I use fieldText it does remove the link, but it just shows the contact ID rather than the Contact Name. Any thoughts?
Justyn
Use <apex:outputText value="{!counselling_practice.Member__r.Name}"/> .
It will display only Name.
Hi
That correction makes sense and the page accepts the changes. However I then get the following error message:
System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Counselling_Practice__c.Member__r
Visualforce Error
The Member fields is a Master-Detail relationship to Contacts. Name of course does existing in Contacts. Is it going to be something to do with my Apex Controller?
Regards
Justyn
In your apex controller instead of retrieving Counselling_Practice__c.Member__c field retrieve "Counselling_Practice__c.Member__r .Name" in your SOQL
Works a dream. Thanks