Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list<Customer_Tool__c> ctListA = new List<Customer_Tool__c>();
- list<Customer_Tool__c> ctListB = new List<Customer_Tool__c>();
- Set<id> ctID = new Set<id>();
- for(Attachment at : trigger.new) {
- ctID.add(at.parentid);
- }
- ctListA = [Select id, CTAttachment__c from Customer_Tool__c where id in: ctID];
- if(ctListA!=null && ctListA.size()>0){
- for(Customer_Tool__c ct : ctListA) {
- ct.CTAttachment__c = 0;
- ct.CTAttachment__c++;
- ctListB.add(ct);
- }
- update ctListB;
- }
Add Comment
Please, Sign In to add comment