Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. List<AggregateResult> acc=[SELECT Name , Prospect_Code__c , COUNT(Id) ids FROM Account where Id Not In (Select AccountId from Contact) And Id Not In (Select AccountId from Opportunity) GROUP BY Name, Prospect_Code__c HAVING count(Id)>1];
  2.  
  3. Map<String,boolean> act = new Map<String,boolean>();
  4.  
  5. for(AggregateResult aggres : acc)
  6.  
  7. {
  8.  
  9. act.put('duplicate__c',true);
  10.  
  11. System.debug('Finding duplicate AccName,ProspCode with no relation with Contact and Opp'+aggres);
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement