function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Geetha saiGeetha sai 

Billing State and Billing Country Values on VF Page

I am trying to display the Billing Country on Visualforce page. When I am dispalying it showing code instead of value.
For example, I want to display United States, but it is displaying US.
Dileep KumarDileep Kumar

Hi Geetha,
This is visualforce page code

<apex:page standardController="Account">
  <apex:form >
      <apex:outputField value="{!Account.BillingCountry}"/><br/>
      <apex:outputField value="{!Account.BillingState}"/>
  </apex:form>
</apex:page>

To run this page click on preview and at the end of the url put : id?AccountId

eg.https://c.ap2.visual.force.com/apex/billing?id=00128000003JnpS

Now you will get Full name of Country.

Please try and let me know 

Thanks,

Dileep

Geetha saiGeetha sai
Hi Dileep,

I am trying to display as follows
Controller
public class sample

    public List<Account> accList {get; set;}
    public sample()
    {
        accList = [SELECT BillingCity, BillingCountry, BillingPostalCode, BillingState, BillingStateCode, BillingStreet FROM Account ];
    }    
}

Page
<apex:repeat value="{!accList}" var="acc">
{!acc.BillingState}
{!acc.BillingCountry}
</apex:repeat>

Thanks,
Geetha.
Dileep KumarDileep Kumar

Hi Geetha,
User-added image

Class code:

public class sample

    public List<Account> accList {get; set;}
    public sample()
    {
        accList = [SELECT BillingCity, BillingCountry, BillingPostalCode, BillingState, BillingStreet FROM Account ];
    }    
}

Visualforce:

<apex:page controller="sample">
  <apex:form >
      <apex:repeat value="{!accList}" var="acc">
        {!acc.BillingState}<br/>
        {!acc.BillingCountry}
       </apex:repeat>
  </apex:form>
</apex:page>

It wil work.If you will open any existing account record and you will see "Billing Address" field please double click on this field after that it will be editable and after that what ever you will save  Country:India .It will show on page india.It was not looking because in your data base it was UK in place of United Kingdom.

Please try it and let me know.

Thanks,

Dileep

Geetha saiGeetha sai
Deepak,

In Account Detail page it is showing New York, When I am trying to display Billing State in VF Page it is displaying NY. Here our orgnization have enabled State and Country Picklists.
User-added imageUser-added image
srinu vassrinu vas
Hi Geetha,
Did you get any solution for this problem,I am facing same issue in my org,If u found any solution,Can you please post the same.

Thanks