+ Start a Discussion
suresh.csksuresh.csk 

How to use custom object pagelayout in VF

Hi.

 

Created a Custom Object A.

The Custom Object A  having text fields and also look-up fields.

 

Then created a VF called testpage.

 

I need to use the Custom Object  A's Page-layout in testpage.

To say simply  I don't need to again re-create the all text fields in the testpage.

I need to insert records to the custom object A using the testpage.

 

Really appreciate for your great ideas.

 

cheers

suresh

 

Best Answer chosen by Admin (Salesforce Developers) 
Arvind1Arvind1

 

<apex:page standardcontroller="Customobject A" tabstyle="Customobject A">
<apex:form>
<apex:pageblock>
<apex:pageblocksection>
give all the fields here as inputfields
</apex:pageblocksection>
</apex:pageblock>
<apex:commandbutton value="Save" action="{!Save}"/>
</apex:form>
</apex:page>

 

 

All Answers

Arvind1Arvind1

 

<apex:page standardcontroller="Customobject A" tabstyle="Customobject A">
<apex:form>
<apex:pageblock>
<apex:pageblocksection>
give all the fields here as inputfields
</apex:pageblocksection>
</apex:pageblock>
<apex:commandbutton value="Save" action="{!Save}"/>
</apex:form>
</apex:page>

 

 

This was selected as the best answer
sforce2009sforce2009

There is no provision of using Readymade pagelayouts in VIsualforce as of now. This is under consideration from salesforce people.

http://community.salesforce.com/t5/Visualforce-Development/What-would-you-expect-to-be-able-to-do-with-the-edit-mode-of/m-p/182293#M23884

If you want to achieve this, You have to recreate the layout using Pageblocks and Pageblock sections like the other guy has suggested.

suresh.csksuresh.csk

Arvind  & Srinivas

Thank you very much for your precious  time and suggestions.

I will go with the pageblock  idea.

 

Thanks

 

ahab1372ahab1372

It actually does exist, check out <apex:detail>

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_compref_detail.htm

 

something like the code below will pull in the page layout you have created for the custom object A

 

<apex:page standardController="CustomObjectA__c">
   <apex:detail subject="{!CustomObjectA__c.id}" relatedList="true" title="false"/> 
</apex:page>