I have an object "Details_Page__c" which has a lookup field "Next_Change__c" associated with it. The object is initialized in my controller class -
Details_Page__c detailsPage = new Details_Page__c();
I want to show this field twice in my visualforce page once with the original label and once with a custom label. In VF page -
<apex:pageBlockSection title="Information" columns="2">
<apex:inputField value="{!detailsPage.Next_Change__c}" />
<apex:inputField value="{!detailsPage.Next_Change__c}" label="Previous Change" />
</apex:pageBlockSection>
The user is allowed to select different lookup values for these fields from the VF page. However, I want to be able to fetch the values of these fields with separate labels in my controller class and use those separately for different purposes. I know I can fetch the value like -
Next_Change__c nextChange = detailsPage.Next_Change__c;
My question is how do I also read the field with the custom label "Previous Change" ?
Next_Change__c previousChange = ?