I cant seem to get the table to be grouped by the ownerID and Sum the Amount withoutadjustments
Controller
public class ForecastListController {
private String GroupParameter = 'Ownerid';
public List<ForecastingItem> getForecastingItem() {
List<ForecastingItem> results = Database.query('SELECT id, SUM(AmountWithoutAdjustments), Ownerid, PeriodID, ProductFamily ' + 'FROM ForecastingItem ' + 'Group BY ' + GroupParameter);
return results;}
}
VF Page
<apex:page controller="ForecastListController">
<apex:pageBlock >
<apex:pageBlockTable value="{!ForecastingItem}" var="FI">
<apex:column value="{!FI.id}"/>
<apex:column value="{!FI.ownerid}"/>
<apex:column value="{!FI.PeriodId}"/>
<apex:column value="{!FI.ProductFamily}"/>
<apex:column value="{!FI.AmountWithoutAdjustments}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Thank you