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
doddod 

Address fields Display on visualforce Page

Hi,

 

I have two types of addresses on my opportunity object like (billing,shipping). i want to display these two type of adresses in following way.

 

              street  country  zip

Billing:

 

Shipping:

 

 

Please give me suggestions to acheive this.

 

HarmpieHarmpie
You want to DISPLAY them like this in a Visual Force page, or do you want to have also the edit fields presented in a sequential order?
doddod

I just want display in visualforce page,so can you please help me out.

 

I tried with below code.But the data is not aligning properly.

 

 

<apex:pageBlock mode="view" >
    <apex:pageBlockTable value="{!Opportunity}" var="a" width="100%" >
        <apex:column width="125px" colspan="1">
            <apex:outputLabel ><b>Billing Address:</b></apex:outputLabel>
        </apex:column>

        <apex:column width="125px" colspan="1">
           
        </apex:column>

</apex:pageBlockTable>

<apex:pageBlockTable value="{!Opportunity}" var="a" width="100%" >
        <apex:column width="125px" colspan="1">
            <apex:outputLabel ><b>Shipping Address:</b></apex:outputLabel>
        </apex:column>

        <apex:column width="125px" colspan="1">
           
        </apex:column>

</apex:pageBlockTable>

Jon SnowJon Snow
Sse fields BillingStreet, BillingCity, BillingState,BillingPostalCode, BillingCountry, BillingLatitude and BillingLongitude instead of BillingAddress field:
 
<apex:outputText value="{!record.BillingCountry}" /><br />
<apex:outputText value="{!record.BillingPostalCode}" />&nbsp;
<apex:outputText value="{!record.BillingState}" />&nbsp;
<apex:outputText value="{!record.BillingCity}" />&nbsp;<br />
<apex:outputText value="{!record.BillingStreet}" />

Reference : https://www.xgeek.net/salesforce/display-address-type-field-on-visualforce-page/