You need to sign in to do that
Don't have an account?
NullPointerException: Attempt to de-reference a null object Adding AccountId to List<Id>
16:5:11.693|METHOD_ENTRY|[10,9]|LIST:Id.add(Id)
16:5:11.693|EXCEPTION_THROWN|[10,9]|System.NullPointerException: Attempt to de-reference a null object
16:5:11.693|METHOD_EXIT|[10,9]|add(ANY)
16:5:11.693|FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object
is the system log...
the code is:
trigger LapsedFunderToFunder on Opportunity (after insert) {
List<Id> effectedAccounts;
for(Opportunity o : Trigger.new){
system.debug('accountid - ' + o.AccountId);
effectedAccounts.add(o.AccountId);
Not sure why an Id won't add to the List<Id>... strange.. There must be something I'm missing.
All Answers