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
Prathyusha JPrathyusha J 

Placing custom object fields on contact page using visual force

Hi Tech gurus,
I'm Salesforce Admin and I'm new to VF page creations.  I have a requirement to create around 30 check box fields, 3 input fields and 1 date field on contact object.  As we are hitting the field limit on Contact object, I would like to create a visual force for the same and add it to contact page layout.  I created a custom object (custom_object) and maintained a look up relation with contact object (custom object name - selected as auto number).  My question is how to place this custom object on standard contact page layout using visual force code?
1) I tried the following code and it is not recognizing the custom object relation (i just mentioned only one checkbox related field in this code for testing purpose)
<apex:page standardController="Contact">
  <apex:pageBlock>
           <apex:pageBlockSection title="Custom Object">
                   <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Custom Object" for="custom_object"/>
                           <apex:outputField id="contact" value="{!Contact.Custom_Object__r.checkboxname1}"/>
                   </apex:pageBlockSectionItem> 
           </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>
2) I also tried to create stand alone fields using visual force page and used standard 'save' button (using contact standard controller).  I added the VF on contact standard page layout just before the related list.  But, when I select checkboxes and save the data on contact page, data is not getting saved.  Is there any process to save the data along with the contact record.  How to save the data in the database along with other contact information?

Which one is better option?  Please suggest me the correct the procedure and guide me to the right direction on this.  It would be a great help.  Thank you in advance for your time and help.