hi,

I am a Force.com developer, trying to implement google chart in
visualforce page.

i want to display a error message when the query returns 0 records, i
am using apex:
PageMessage tag in page and  ApexPages.addmessage(new
ApexPages.message(ApexPages.severity.ERROR,'You do not have any
Accounts')); in the class.

Class code:

List<AggregateResult> List= new List<AggregateResult>();
         List=[Select
Account.Id,Account.Name,SUM(Lead_Score_Implicit__c) from Contact where
Account.Id In: AccountIdSet and Account.OwnerId =:userId group By
Account.Name,Account.Id order by SUM(Lead_Score_Implicit__c) desc
limit 10 ];

if(List.size()== 0 ){
 ApexPages.addmessage(new
ApexPages.message(ApexPages.severity.ERROR,'You do not have any
Accounts'));
        return null;
                          }
Page Code:
<apex:page controller="GoogleChartsController1" showHeader="false"
    sidebar="false">
    <apex:pageMessage severity="ERROR"/>

</apex:page>

Quick response is Appreciated.

Thanks,
Megha

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to