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
khushbu dubeykhushbu dubey 

i have written code in visualforce page. but here account field is lookup of accounts object..is it correct??

<apex:page standardController="opportunity" recordSetVar="opp">
<apex:pageBlock title="List View">
<apex:pageBlockTable value="{!opp}" var="o">
<apex:column value="{!o.Name}"/>
<apex:column value="{!o.Type}"/>
<apex:column value="{!o.ExpectedRevenue}"/>
<apex:column value="{!o.Amount}"/>
<apex:column value="{!o.StageName}"/>
<apex:column value="{!o.Account}"/>
</apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>

 
Amit Chaudhary 8Amit Chaudhary 8
Please try below code. Please try AccountID
 
<apex:page standardController="opportunity" recordSetVar="opp">
<apex:pageBlock title="List View">
<apex:pageBlockTable value="{!opp}" var="o">
<apex:column value="{!o.Name}"/>
<apex:column value="{!o.Type}"/>
<apex:column value="{!o.ExpectedRevenue}"/>
<apex:column value="{!o.Amount}"/>
<apex:column value="{!o.StageName}"/>
<apex:column value="{!o.Accountid}"/>
</apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>

Let us know if this will help you
Mahesh DMahesh D
Hi Khushbu,

Please find the below modified code:

(1) Corrected the error from Account to AccountId.
(2) Also Added additional columns for your future reference to access Account record values.
(3) Changed the alignment properly.
(4) Tested the code in my DE environment.

 
<apex:page standardController="opportunity" recordSetVar="opp">
    <apex:pageBlock title="List View">
        <apex:pageBlockTable value="{!opp}" var="o">
            <apex:column value="{!o.Name}"/>
            <apex:column value="{!o.Type}"/>
            <apex:column value="{!o.ExpectedRevenue}"/>
            <apex:column value="{!o.Amount}"/>
            <apex:column value="{!o.StageName}"/>
            <apex:column value="{!o.AccountId}"/>
            <apex:column value="{!o.Account.Name}"/>
            <apex:column value="{!o.Account.AccountNumber}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

Please do let me know if it helps.

Regards,
Mahesh​