You need to sign in to do that
Don't have an account?
Tobias Hagge
Display field from related object
I am building a Visualforce page for the Opportunity custom console. I want to build a page with the basic contact information, how do I get the contact fields? I created a lookup(Contact) on the Opportunity
Thanks
<apex:page standardController="Opportunity" showheader="false" > <apex:form > <apex:pageBlock > <apex:pageBlockSection collapsible="false" columns="5"> <apex:pageblocksectionItem > <apex:inputField value="{!Contact.Email}"/> </apex:pageblocksectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>How can I modify this?
Thanks
<apex:inputField value={!Opportunity.Contact_Name__r.Email} />
All Answers
If Lookup(Contact) field's API name on opportunity is Contact__c than you can get contact information by this way
<apex:inputField value="{!Opportunity.Contact__r.Email}"/>
Thanks
Error Error: Could not resolve the entity from <apex:inputField> value binding '{!Opportunity.Contact_Name__c.Email}'. <apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.
<apex:inputField value={!Opportunity.Contact_Name__r.Email} />