Using FieldSets in Visualforce

Visualforce Nov 7, 2014

What is FieldSet?, A field set is a grouping of fields, for example UserInfo is a field Set where it contains basic details like User firstName, lastName, email, title, mobile, these can be grouped under a FieldSet

Visualforce Page

<apex:page standardController="Account">
    <!-- To Display field Values Only -->
    <apex:repeat value="{!$ObjectType.Account.FieldSets.thephani__Account_Information}" var="f"> 
        <apex:outputText value="{!Account[f]}" /><br/>
    <!-- To Displya field Name, field Label, field datatype & field Value-->
    <apex:pageBlock title="Fields in Proper Names">
        <apex:pageBlockTable value="{!$ObjectType.Account.FieldSets.thephani__Account_Information}" var="f">
            <apex:column value="{!f}">
                <apex:facet name="header">API Name</apex:facet>
            <apex:column value="{!f.Label}">
                <apex:facet name="header">Label</apex:facet>
            <apex:column value="{!f.Type}" >
                <apex:facet name="header">Data Type</apex:facet>
            <apex:column value="{!Account[f]}" headerValue="Field Value  bnb  " />


Phanindra Mangipudi

Salesforce, Lightning Web Componets, Node.Js, Angular 2+, Bootstrap