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
Maneesh Gupta 11Maneesh Gupta 11 

Calculated field in Pageblock table

Hi Experts,

I have a simple requirement. Its for the computation of Simple Interest. My Custom object contains 3 fields - Principal_Amt__c, Years__c & Rate__c
I need to show these 3 fields in a page block table with an additional 4th field (Simple Interest) which will be calculated run time when the page is displayed.

I know there could be various ways to achive this (extension, Java Script function etc.) but I am curious to understand if I really need to write an extension/JS function to compute Simple Interest?
Can't we do this simple field calculation in the VF page itself?
For e.g. something like this - <apex:outputtext value = "{!Principal}" * "{!years}" * "{!Rate}" />