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
SFDC Forum 007SFDC Forum 007 

account repeat stmt

Hi,

 

 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)
                 accIdSet.add(callRep.Account__c);
                 
            if(callRep.Call_plan__c !=null)
                 callplanIdSet.add(callRep.Call_plan__c);  
                 
            callReppaMap.put(callRep.Contact__c,callRep);    

 

Please help me out with my case

 

 

Thanks in advance