+ Start a Discussion
khushbu dubeykhushbu dubey 

this apex code is correct or not bcoz in address field ,it is showing error

<apex:page standardController="Lead" recordSetVar="ld">
<apex:pageBlock title="list views">
<apex:pageBlockTable value="{!ld}" var="l6">
<apex:column value="{!l6.address}"/>
<apex:column value="{!l6.annualrevenue}"/>
<apex:column value="{!l6.email}"/>
<apex:column value="{!l6.fax}"/>
</apex:pageBlockTable>
</apex:pageBlock>
  
</apex:page>

 
Yury BondarauYury Bondarau
What error do you get when compile or run this code?

You can check a list of fields available on Lead object here https://help.salesforce.com/apex/HTViewHelpDoc?id=leads_fields.htm&language=en
kalpeshs91kalpeshs91
Instead of <apex:column value="{!l6.address}"/>
use,
<apex:column value="{!l6.Street}"/>
<apex:column value="{!l6.City}"/>
<apex:column value="{!l6.State}"/>
<apex:column value="{!l6.PostalCode}"/>
<apex:column value="{!l6.Country}"/>

Mark this as correct answer, if this solve your issue.

-Kalpesh Surana
kalpeshsurana@live.com
+91 9028851237
Richard Jimenez 9Richard Jimenez 9
Hi khushdu,

Address is not a valid standard field. Change this to street, city etc. N.b. I've changed your variable names for readability.

<apex:page standardController="Lead" recordSetVar="Leads">
<apex:pageBlock title="list views">
<apex:pageBlockTable value="{!Leads}" var="lead">
<apex:column value="{!lead.street}"/>
<apex:column value="{!lead.annualrevenue}"/>
<apex:column value="{!lead.email}"/>
<apex:column value="{!lead.fax}"/>
</apex:pageBlockTable>
</apex:pageBlock>
 </apex:page>

Thanks,
Richard.
Amit Chaudhary 8Amit Chaudhary 8
Hi Khushbu,

I you are using right code but wrong API name your code. Address is composite field
PLease check below post to see all Lead field API
1) https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_lead.htm
Address
The compound form of the address. Read-only. See Address Compound Fields (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_address.htm)for details on compound address fields.

Please let below code
<apex:page standardController="Lead" recordSetVar="LeadList">
	<apex:pageBlock title="list views">
		<apex:pageBlockTable value="{!LeadList}" var="leadObj">
			<apex:column value="{!leadObj.Street}"/>
			<apex:column value="{!leadObj.State}"/>
			<apex:column value="{!leadObj.City}"/>
			<apex:column value="{!leadObj.PostalCode}"/>
			<apex:column value="{!leadObj.Country}"/>

			<apex:column value="{!leadObj.annualrevenue}"/>
			<apex:column value="{!leadObj.email}"/>
			<apex:column value="{!leadObj.fax}"/>
		</apex:pageBlockTable>
	</apex:pageBlock>
</apex:page>

Let us know if this will help you

 
khushbu dubeykhushbu dubey
sorry,but it is not working..
Amit Chaudhary 8Amit Chaudhary 8
Hi Khushbu,

I tested above code i my person org which is working fine. Can you please let us know what issue you are facing
<apex:page standardController="Lead" recordSetVar="LeadList">
	<apex:pageBlock title="list views">
		<apex:pageBlockTable value="{!LeadList}" var="leadObj">
			<apex:column value="{!leadObj.Street}"/>
			<apex:column value="{!leadObj.State}"/>
			<apex:column value="{!leadObj.City}"/>
			<apex:column value="{!leadObj.PostalCode}"/>
			<apex:column value="{!leadObj.Country}"/>

			<apex:column value="{!leadObj.annualrevenue}"/>
			<apex:column value="{!leadObj.email}"/>
			<apex:column value="{!leadObj.fax}"/>
		</apex:pageBlockTable>
	</apex:pageBlock>
</apex:page>
User-added image

Please let us know if this will help you