You need to sign in to do that
Don't have an account?
How to get Acoount object values in a VF page whose standard contoller is Contact??
Hi All
I have created a VF page to add a contact without using the standard Contacts tab.
See the code below. I am able to save the contact info with no issues. But what I want is
when I select an Account in this page which is a look up I have to get the Revenue value
for the selected Account before I save the page. Is this possible in Visual Force Page?
If possible how this can be achieved?
<apex:page standardController="Contact">
<script language="JavaScript">
function showAccRevenue()
{ alert ("How to get a/c revenue");}
</script>
<apex:pageBlock>Create New Contact Quickly</apex:pageBlock>
<apex:Form>
<table>
<tr><td>First name:</td>
<td><apex:inputField value="{!Contact.FirstName}"/></td></tr>
<tr><td>Last name: </td>
<td><apex:inputField value="{!Contact.LastName}"/> </td></tr>
<tr><td>Phone: </td>
<td> <apex:inputField value="{!Contact.Phone}"/> </td></tr>
<tr><td>Account</td>
<td><apex:inputField id="txtAcc" onblur="showAccRevenue();" value="{!Contact.AccountId}"/></td></tr>
</table>
<apex:commandButton action="{!save}" value="Save"/>
</apex:Form></apex:page>
Thanks for the response Ron. But I get a databinding error as shown below.
Could not resolve the entity from <apex:outputField> value binding '{!Contact.Account.AnnualRevenue}'
Thanks for the response Ron. But I get a databinding error as shown below.
Could not resolve the entity from <apexutputField> value binding '{!Contact.Account.AnnualRevenue}'
<apex:page standardController="Account">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are displaying values from the {!account.name} account and a separate contact
that is specified by a query string parameter.
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1">
<apex:column>{!contact.Name}</apex:column>
</apex:dataTable>
</apex:pageBlock>
<apex:detail subject="{!$CurrentPageReference.parameters.cid}" relatedList="false"
title="false"/>
</apex:page>
This to call the Account related contact data in your Application .
May be you can get some help .
Vivek Manchanda
also, do you have the contact or account id sepcified on the url
.../apex/yourpage?id=001xxxxxxx
Message Edited by Ron Hess on 03-02-2008 11:07 AM