Guest User

Untitled

a guest
Dec 15th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. list<Customer_Tool__c> ctListA = new List<Customer_Tool__c>();
  2. list<Customer_Tool__c> ctListB = new List<Customer_Tool__c>();
  3. Set<id> ctID = new Set<id>();
  4.  
  5. for(Attachment at : trigger.new) {
  6. ctID.add(at.parentid);
  7. }
  8.  
  9. ctListA = [Select id, CTAttachment__c from Customer_Tool__c where id in: ctID];
  10. if(ctListA!=null && ctListA.size()>0){
  11. for(Customer_Tool__c ct : ctListA) {
  12. ct.CTAttachment__c = 0;
  13. ct.CTAttachment__c++;
  14. ctListB.add(ct);
  15. }
  16. update ctListB;
  17. }
Add Comment
Please, Sign In to add comment