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
rajesh k 10rajesh k 10 

How to display below page Outputfield values ?

Hi,
      Using below code i displayed outputfields,but how to retrive these fields related values?

page:
......
<apex:page id="pageId" standardcontroller="Account" extensions="Detailpage1Cls"> 
<apex:form id="formId"> 
    <apex:pageblock id="pbId"> 
        <apex:pageblocksection columns="1" id="pbsIs"> 
            <apex:repeat value="{!$ObjectType.Account.FieldSets.account_fields}" var="f"> 
                <apex:outputField value="{!Account[f]}"/> 
            </apex:repeat> 
        </apex:pageblocksection> 
    </apex:pageblock> 
</apex:form> 
</apex:page>

Controller
----------------
public class Detailpage1Cls {

public List<Account> records{get; set;}

    public Detailpage1Cls(ApexPages.StandardController controller) {

        records=new List<Account>();
       
        records=[SELECT name,phone,fax FROM Account];
    }

}

help me......
Best Answer chosen by rajesh k 10
Vatsal KothariVatsal Kothari
Hi,

You can refer below visulaforce page code:

<apex:page id="pageId" standardcontroller="Account" extensions="Detailpage1Cls"> 
	<apex:form id="formId"> 
		<apex:pageblock id="pbId"> 
			<apex:pageblocksection columns="1" id="pbsIs"> 
				<apex:repeat value="{!records}" var="f"> 
					<apex:outputField value="{!f.Name}"/> 
				</apex:repeat> 
			</apex:pageblocksection> 
		</apex:pageblock> 
	</apex:form>
</apex:page>

If this solves your problem, kindly mark it as the best answer.

Thanks,
Vatsal

All Answers

Prem_PalPrem_Pal
Your page looks OK to me.

Have you given id in the URL?
Vatsal KothariVatsal Kothari
Hi,

You can refer below visulaforce page code:

<apex:page id="pageId" standardcontroller="Account" extensions="Detailpage1Cls"> 
	<apex:form id="formId"> 
		<apex:pageblock id="pbId"> 
			<apex:pageblocksection columns="1" id="pbsIs"> 
				<apex:repeat value="{!records}" var="f"> 
					<apex:outputField value="{!f.Name}"/> 
				</apex:repeat> 
			</apex:pageblocksection> 
		</apex:pageblock> 
	</apex:form>
</apex:page>

If this solves your problem, kindly mark it as the best answer.

Thanks,
Vatsal
This was selected as the best answer
rajesh k 10rajesh k 10
Hi,
         How to check in an object record is there or not ?
Vatsal KothariVatsal Kothari
If List doesn't contains any records, than it wont print anything.
Apex:repeat will print the value if records are there in the list.
If you want to try this, you can try by appending limit 0 in your query.
rajesh k 10rajesh k 10
Hi,
       I have 3 objects ob1(junction object of ob2 and ob3),ob2,ob3.i displayed object 2 fields in a pageblock table one column as command link.When user click this command link page refers to outputfields details page(using fieldset i displayed output fields of command link related record as detail page).I this detail page i gave one button as "view pdf" ,when user click this view pdf button ,check this cord is there or not in ob3.Suppose record is there means update that date of object How?

please help me.............