Guest User

Untitled

a guest
Feb 19th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. List<Contact> cont = new List<Contact>();
  2. Map<String, inscor__Customer_Quote__c> cqMap = new Map<String, inscor__Customer_Quote__c>();
  3.  
  4. for (inscor__Customer_Quote__c cq : [SELECT Id, inscor__Contact__c FROM inscor__Customer_Quote__c]) {
  5. cqMap.put(cq.inscor__Contact__c, cq);
  6. }
  7.  
  8. for (Contact c : [SELECT Id FROM Contact WHERE inscor__External_Reference_ID__c = null]) {
  9. if (!cqMap.containsKey(c.Id)) {
  10. cont.add(c);
  11. }
  12. }
  13.  
  14. delete cont;
Add Comment
Please, Sign In to add comment