Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger AccountSVOC on Account (after update) { List <SVOC__c> SVOCs = new List <SVOC__c> (); System.debug('Chris in trigger'); for(Account a: Trigger.new) { System.debug('Chris in account loop'); if( (a.SVOC__c != null ) && (a.SVOC__c != Trigger.oldMap.get(a.Id).SVOC__c) ) { System.debug('Chris in status changed'); SVOC__c SVOC = new SVOC__c (); SVOC.SVOC_ID__c = a.Id; System.debug('Chris creating new SVOC and adding to list'); SVOCs.add(SVOC); } } if(SVOCs.size()>0) { System.debug('Chris has values to insert = '+ SVOCs.size()); try{ insert SVOCs; }catch (System.Dmlexception e) { system.debug (e); } } }