+ Start a Discussion
AndyuxAndyux 

get contact title visualforce

I have a visualforce page, related to the Opportunity Object.
There is a  lookup field (Influencer1__c), which looksup to the Contact object, name. How can i create another field to show the contacts title?
<td valign="top" width="120"  bgcolor="#DCE1E9"><apex:outputField value="{!StrategicSales__c.Influencer1__c}" > 
  <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 
    hideOnEdit="editButton" event="ondblclick" 
    changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
      </apex:outputField></td>
Thanks!
 
Best Answer chosen by Andyux
Jerun JoseJerun Jose
On top of the options mentioned above, you could also use the relationship directly in VF and print something like
 
<apex:outputText value="{!StrategicSales__c.Influencer1__r.Title}" />

All Answers

JeffreyStevensJeffreyStevens
You can also create a custom formula field on the Opportunity - called ContactTitle.  Formula would be Influencer1__c.Title. (I think)
Jerun JoseJerun Jose
On top of the options mentioned above, you could also use the relationship directly in VF and print something like
 
<apex:outputText value="{!StrategicSales__c.Influencer1__r.Title}" />
This was selected as the best answer
AndyuxAndyux
Jerun, Opportunity is the related object, so i didn't thinks this would work, but it does, thank you.