0

In the page, I have to take one field with same name in two columns how is it possible...in page layout it's not showing Name twice its showing only once ....is it possible with Visual force page...suppose i have field name as Name then that Name field should be display in two columns thanks advance

Click here for image

enter image description here

1

With your requirement, it can be understood, that you need two labels and each label has a text field. Try this if it helps:

<apex:page standardController="Object__c">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection title="Two Names" columns="2">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Name"/>
                    <apex:inputField value="{!Object__c.FieldName__c}/>
                </apex:pageBlockSectionItem>

                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Name"/>
                    <apex:inputField value="{!Object__c.FieldName__c}"/>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>

            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
0

Add a custom field to the object with the same label "Name":

Extra Name Field

You can then drag this field into a layout in addition to the standard "Name" field.

0

Page layout doesn't allow to add onc field twice, either you need to create a duplicate field with same name or go for visualforce page solution where you can put input field component twice

<apex:page>
<apex:form>
<apex:inputfield value="{!fieldname}"/>
<apex:inputfield value="{!fieldname}"/>
</apex:form>

</apex:page>
0

Himanshu is right, in addition to his answer :

Here is two column layout for VF :

<apex:page standardController="YourObject__c">
<apex:form>
   <apex:pageBlock>
      <apex:pageBlockSection>
         <apex:inputField value="{!YourObject__c.Name}"/>
         <apex:inputField value="{!YourObject__c.Name}"/>
      </apex:pageBlockSection>
   </apex:pageBlock>
</apex:form>
</apex:page>
  • Thanks Erkan, Suppose in my first name field X is there now am given y as second field name....now how to override the second field name "Y" in first Field Name.... – srihari May 17 '16 at 14:58
  • What do you mean "override" ? – erkan çipil May 17 '16 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.