+ Start a Discussion

Quote Page

Im designing a visualforce page to display info from a custom quote object.


The basic layout for displaying the items would be something like this:


Product Name          Price          Quantity        Cost         Revenue        Profit


   Product 1               10                 3                4                 30             18


   Product 2               50                 2                20               100           60






What i then want to do is Total the Revenue And Profit Columns at the end. Would it best to go around this by creating a visualforce page and then using apex classes to make the calculations.


If anyone knows of a simpler way to create this visualforce page it would be a great help




Hi Matt,

You can do this in the controller also and on the VF page itself.

If you do this in the controller, then you have to build a wrapper class adding the total as a entity apart from the Quote object.

Doing this in the VF page is even simpler. You can just use the component <apex:variable> whose value you can keep calculating inside the table and show the final calculated value in the last row of the table!