I need to create a visual force page to compare an old record with a newly cloned record.
For example:
Existing Fields. Account (Old Record) Account (new Record)
id 1234456 1234456
name Sample 1 Sample 1
IsActive__c false true
contact Contact 1 Contact 2
I have a controller which pulls all the field names dynamically and feeds it to VF page. But I need to know how to pass record values of fields, old values, and new record values using the same apex:repeat tag. Can anyone point me towards the right direction??
Thanks.
Update: I tried using wrapper class and seems like I'm half way through...However, It is only displaying the first column
Controller Code:
public List<Wrapper> WrapperList { get; set; }
WrapperList.add(new Wrapper(fieldapiname,currentacc,previousacc));
VF Code:
<apex:repeat value="{!wrapperList}" var="key" id="theRepeatId">
<tr>
<td><apex:outputText value="{!key.fieldapiname}" id="theValue"/><br/></td>
<td><apex:outputText value="{!key.currentacc}" id="theValue1"/><br/></td>
<td><apex:outputText value="{!key.previousacc}" id="theValue2"/><br/></td>
</tr>