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
GaneeeshGaneeesh 

Getting undefined error in javascript vidualforce page..

here i am integrating google charts apart from this i am using AggregateResult funtion here i have sum of the annual annual revenue and grouping the rating but here the problem is i have displayed sum of annual revenue but i am not able to display the labels of Ratig field(Hot,Warm,Cold,Others) how can i get this can anybody help me and this is my code.

 

result = sforce.connection.query("Select Rating, sum(Annualrevenue) sales " + "from Account group by Rating " );
        // Iterate over the result
        var it = new sforce.QueryResultIterator(result);
        while(it.hasNext()) {
            var record = it.next();
        alert(record.rating);   
            // Add the data to the table
            data.addRow([record.rating, {v:parseFloat(record.sales), f: formatCurrencyLabel(record.sales)}]);
        }

 

when ever i test this using record.rating it shows undefiened, value if i display record.sales it show the value of sales.... how can i get rating values anybody help me please.............?

Best Answer chosen by Admin (Salesforce Developers) 
SKiranSKiran
Since javascript is a case sensetive language, you might need to use correct field name, in your case it should be "record.Rating" not "record.rating". Accept this as answers if this solves your problem. Thanks!!!!!!

All Answers

SKiranSKiran
Since javascript is a case sensetive language, you might need to use correct field name, in your case it should be "record.Rating" not "record.rating". Accept this as answers if this solves your problem. Thanks!!!!!!
This was selected as the best answer
GaneeeshGaneeesh
Thanks Mr Kiram its working ....