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
4 Answers
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>
Add a custom field to the object with the same label "Name":
You can then drag this field into a layout in addition to the standard "Name" field.
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>
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....– srihariCommented May 17, 2016 at 14:58
-