[SalesForce] How to Embed Custom Object Page Layout into Visual Force page

I have a One custom object(Used for searching purpose) and i want to add that particular object's all the fields into the visual force page what is the best way to do this ? I need

Field name-Field Entry object 

Style for my purpose.

Best Answer

To display all fields or particular fields of an object in visualforce page you need to take that object in standard controller and give a recordsetvar attribute anything. In pageblocktable give the recordsetval as a value.for this you can go through following code.

<apex:page sidebar="false" StandardController="Rule__c" recordSetVar="AList" >
    <apex:form >
        <apex:pageBlock title=" All Accounts Available">
            <apex:pageBlockSection columns="1">
                <apex:pageBlockTable value="{!AList}" Var="B">
                    <apex:column value="{!B.Object__c}"/>
                    <apex:column value="{!B.Name}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

if it is useful for you please accept it and give kudo's.

Related Topic