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
Varshitha KVarshitha K 

copying values in a column and assigning it to another column

I have the above table:User-added image now i want the below table:User-added imageplz explain me proper code.
Pankaj_GanwaniPankaj_Ganwani
Hi,

I referred the code mentioned in your previous post. Here is the solution for this:
 
Controller:

public class RecordWrapper
{
    public String nameValue {get;private set;}
	public Decimal genericValue {get; private set;}
	public String dataType		{get; private set;}
	
	public RecordWrapper(String nameValue, Decimal genericValue, String dataType)
	{
	     this.nameValue = nameValue;
		 this.genericValue = genericValue;
		 this.dataType = dataType;
	}
}

public List<RecordWrapper> getRecordWrapperRecords()
{
    List<RecordWrapper> lstRecordWrapper = new List<RecordWrapper>();
	mlist=[select Id, Name, Metric_description__c,Metric_board__c from Metric__c where Metric_board__c=: mb.Metric_board__c];
 
    for(Evaluation_by_metric__c obj : [select id,Monthly__c,name,lightforce1989__Actual_currency__c,lightforce1989__Actual_percent__c,lightforce1989__Actual_number__c,lightforce1989__Generic_del_del__c from Evaluation_by_metric__c where Metric__c in:mlist])
	{
	     if(obj.lightforce1989__Actual_currency__c!=null)
		    lstRecordWrapper.add(new RecordWrapper(obj.name, obj.lightforce1989__Actual_currency__c, 'Currency'));
		else if(obj.Actual_percent__c!=null)
			lstRecordWrapper.add(new RecordWrapper(obj.name, obj.Actual_percent__c, 'Percent'));
		else if(obj.lightforce1989__Actual_number__c!=null)
			lstRecordWrapper.add(new RecordWrapper(obj.name, obj.lightforce1989__Actual_number__c, 'Number'));
	}
  
    return lstRecordWrapper;  
  
}

VF page:

<apex:pageBlockTable value="{!RecordWrapperRecords}" var="e" >
  
  <apex:column>
	<apex:facet name="header">Name</apex:facet>
	{!e.nameValue}
  </apex:column>
  <apex:column>
	<apex:facet name="header">Generic</apex:facet>
	  <apex:outputPanel rendered={!e.dataType == 'Currency'}>
		<apex:outputText value={0,number,currency}>
			<apex:param value="{!e.lightforce1989__Actual_currency__c}"/>
		</apex:outputText>
	  </apex:outputPanel>
	  
	  <apex:outputPanel rendered={!e.dataType == 'Percent'}>
		<apex:outputText value={0,number,0}%>
			<apex:param value="{!e.Actual_percent__c}"/>
		</apex:outputText>
	  </apex:outputPanel>
	  
	  <apex:outputPanel rendered={!e.dataType == 'Number'}>
		<apex:outputText value="{!e.lightforce1989__Actual_number__c}"/>
	  </apex:outputPanel>
  </apex:column>
   
</apex:pageBlockTable>

Please let us know if this makes sense to you.