You need to sign in to do that
Don't have an account?
Mathew Andresen 5
Contact address not displaying in visualforce page
Hi,
I'm just starting to build my page, but I'm having some trouble getting a contact's address to display (other contact info displays fine).
I get the error "Unsupported type common.api.soap.wsdl.Address encountered"
Thanks,
public class ContractClass {
Contact oppContact = new Contact();
Opportunity myOpp = new Opportunity();
String oppId;
String acctId;
public ContractClass() {
oppId = '006R0000008fsEY';
myOpp = [SELECT Id, Amount, Account.Name, Account.Id FROM Opportunity WHERE Id = :oppId LIMIT 1];
acctId = myOpp.Account.Id;
oppContact = [SELECT FirstName, LastName, MailingAddress FROM Contact WHERE accountId = :acctId LIMIT 1];
}
public Opportunity getOpportunity() {
return myOpp;
}
public Contact getContact() {
return oppContact;
}
}
I'm just starting to build my page, but I'm having some trouble getting a contact's address to display (other contact info displays fine).
I get the error "Unsupported type common.api.soap.wsdl.Address encountered"
Thanks,
<apex:page controller="ContractClass"> <apex:pageBlock title="Client Information"> <apex:pageblocksection columns="2"> <apex:outputText label = "Contact Name" value="{!Contact.FirstName} {!Contact.LastName}"/> <apex:outputText label = "License Company" value="{!Opportunity.Account.Name}"/> <apex:outputText label="Mailing Address" value="{!Contact.MailingAddress}"/> </apex:pageblocksection> </apex:pageBlock> </apex:page>
public class ContractClass {
Contact oppContact = new Contact();
Opportunity myOpp = new Opportunity();
String oppId;
String acctId;
public ContractClass() {
oppId = '006R0000008fsEY';
myOpp = [SELECT Id, Amount, Account.Name, Account.Id FROM Opportunity WHERE Id = :oppId LIMIT 1];
acctId = myOpp.Account.Id;
oppContact = [SELECT FirstName, LastName, MailingAddress FROM Contact WHERE accountId = :acctId LIMIT 1];
}
public Opportunity getOpportunity() {
return myOpp;
}
public Contact getContact() {
return oppContact;
}
}
The MailingAddress field of Contact can not be used as a field when it comes to the API as far as I knew. The same is for Billing/Mailing Address on Account.
Hope this helps..
- Harsha
All Answers
Output Field as a tag, is capable of handling any sobject or type.
The MailingAddress field of Contact can not be used as a field when it comes to the API as far as I knew. The same is for Billing/Mailing Address on Account.
Hope this helps..
- Harsha
Doesn't seem to work, I get the error "Unsupported type MailingAddress encountered."
{!Contact.MailingCity} etc does work, I will just use that.
Thanks,
[select MailingStreet, MailingCity, MailingState, MailingPostalCode, MailingCountry from contact]
VfPage:---
<apex:inputField value="{!row.theAccount.MailingStreet}"/>
<apex:inputField value="{!row.theAccount.MailingCity}"/>
<apex:inputField value="{!row.theAccount.MailingState}"/>
<apex:inputField value="{!row.theAccount.MailingPostalCode}"/>
<apex:inputField value="{!row.theAccount.MailingCountry}"/>