Layout Metadata
<!-- Each Section on the page has a section in the XML file --> <layoutSections> <customLabel>false</customLabel> <detailHeading>false</detailHeading> <editHeading>true</editHeading> <label>Account Information</label> <!-- Then each Column in each Section --> <layoutColumns> <!-- Then each field in each section - Notice the <behavior> tag - Edit or Read Only --> <layoutItems> <behavior>Edit</behavior> <field>RecordTypeId</field> </layoutItems> <layoutItems> <behavior>Edit</behavior> <field>OwnerId</field> </layoutItems> <layoutItems> <behavior>Required</behavior> <field>Name</field> </layoutItems> <layoutItems> <behavior>Edit</behavior> <field>ParentId</field> </layoutItems> </layoutColumns> <layoutColumns> <layoutItems> <behavior>Edit</behavior> <field>Phone</field> </layoutItems> <layoutItems> <behavior>Edit</behavior> <field>Fax</field> </layoutItems> <layoutItems> <behavior>Edit</behavior> <field>Website</field> </layoutItems> </layoutColumns> <style>TwoColumnsTopToBottom</style> </layoutSections> <layoutSections> <customLabel>true</customLabel> <detailHeading>true</detailHeading> <editHeading>true</editHeading> <label>Next Section</label> <layoutColumns> <layoutItems> <behavior>Edit</behavior> <field>Field_Name__C</field> </layoutItems> <layoutItems> <behavior>Edit</behavior> <field>Field2_Name__c</field> </layoutItems> </layoutColumns> <layoutColumns> <layoutItems> <behavior>Edit</behavior> <field>Field3_Name__c</field> </layoutItems> </layoutColumns> <style>TwoColumnsLeftToRight</style> </layoutSections>
Imagine how easy it will be to create a read only version of the page for a particular profile - just change all the <behavior>Edit</behavior> tags to <behavior>Readonly</behavior>