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
Rahul AlladaRahul Allada 

To Add the values coming from a controller of VF page

I have some integer fields coming up from the controller to the Vf page. The controller looks like this:

public with sharing class QuotePDFController {
public string parId;
public quote__c quotesRecords {get;set;}
public QuotePDFController(ApexPages.StandardController standardController){
    quotesRecords = new Quote__c();
    parId = standardController.getId();
    quotesRecords = [select Id,Name, (SELECT Onetime_Fee__c,Number_of_Days__c,Storage_Cost__c FROM Quote_Line_Items__r) FROM Quote__c where Id =: parId ];
    Quote_Line_Item__c[] qli = quotesRecords.Quote_Line_Items__r;
}}

To sum up, a single quote has multiple quote line items. And I have to perform (Onetime_Fee__c * Number_of_Days__c) + Storage_Cost__c and display it on VF page for every repeat of Quotelineitems 
<apex:repeat var="qli" value="{!quotesRecords.Quote_Line_Items__r}">
How to do?
ANUTEJANUTEJ (Salesforce Developers) 
Hi Rahul,

Why not have a formula field on the quote line item and simply fetch and show this on the visualforce page?

Is there a reason as I think that would be the better approach?

Looking forward to your response.

Thanks.