+ Start a Discussion
SFDC Forum 007SFDC Forum 007 

account repeat stmt



 Please help me out with my issue


I have a call report object where call plan is attached to it, whre the corresponding accounts are displayed in a pdf, but my issue wen i create a new call report on today's date along with the existing call report created on todays date , the accounts are getting displayed twice with the same name , where i want it to be displayed only once.



Its in this line of my controller


crList=[select id,Contact__c,Date__c,Call_plan__c,Account__r.Name,Account__c,Account__r.id,Account__r.BillingCity,Account__r.BillingStreet,Account__r.BillingState,Account__r.BillingCountry,Account__r.BillingPostalCode,Account__r.phone,Account__r.Type,Account__r.Segment_Status__c,Account__r.Total_Number_Of_Patients__c,Account__r.No_of_Seats__c,Objective__r.Name,Objective2__r.Name from Call_Report__c where CallDate__c=TODAY and OwnerId=:userid];
       System.debug('crList==> '+crList);   
        for(Call_Report__c callRep:crList){
             if(callRep.Account__c !=null)
            if(callRep.Call_plan__c !=null)


Please help me out with my case



Thanks in advance