I am tasked with creating an inline view from the accounts view page that shows opportunity amounts (won-closed) for the 12 months of the year, a total amount field, and prior year amounts, associated to a particular account.
I am on the professional edition, so I understand I cannot make custom classes/controllers.
I found this snippet of code online, but was wondering if there was any equivalent with a standard controller that I could use, and any modification/addition to the code to more tailor it to my requirements?
VF page :
<apex:page controller="CalculationOnVFCnt" id="thePage">
<apex:form id="theForm">
<apex:pageblock id="theBlock">
<apex:pageBlockTable value="{!Opportunities}" var="oppty" id="theBlockTable" >
<apex:column headerValue="Name">
<apex:outputField value="{!oppty.Name}"/>
</apex:column>
<apex:column headerValue="Amount">
<apex:outputField value="{!oppty.Amount}"/>
</apex:column>
<apex:column headerValue="Total Amount">
<apex:outputText id="amountM"/>
<script>
var amount = '{!oppty.Amount}';
var d = new Date();
var n = d.getMonth()+1;
var total = amount*n;
var elementId = document.getElementById('{!$Component.amountM}')
elementId.innerHTML= total;
</script>
</apex:column>
</apex:pageblockTable>
</apex:pageblock>
</apex:form>
</apex:page>
And the controller:
public Class CalculationOnVFCnt {
public List<Opportunity> getOpportunities() {
return [select Id,name,amount from opportunity ];
}
}
I have it envisioned as looking something like:
| Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec ||Total|
2014| 199 | 0 | 50 | etc | etc | etc | etc | etc | etc | etc | etc | etc ||xxxxx|
2013| 100 | 25 | 35 | etc | etc | etc | etc | etc | etc | etc | etc | etc ||xxxxx|
2012| 25 | 400 | 72 | etc | etc | etc | etc | etc | etc | etc | etc | etc ||xxxxx|
I'm not a coder, so any help would be much appreciated.