You need to sign in to do that
Don't have an account?
SFDCAdmin73
System.NullPointerException: Attempt to de-reference a null object - PLEASE HELP
The following errors were encountered while processing an incoming email:
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : SetTaskTypeToEmail: execution of BeforeInsert
caused by: System.NullPointerException: Attempt to de-reference a null object
Trigger.SetTaskTypeToEmail: line 6, column 1
I am not sure how to resolve this issue. It is a simple trigger. Please see code below. I appreciate any help. Thanks!
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : SetTaskTypeToEmail: execution of BeforeInsert
caused by: System.NullPointerException: Attempt to de-reference a null object
Trigger.SetTaskTypeToEmail: line 6, column 1
I am not sure how to resolve this issue. It is a simple trigger. Please see code below. I appreciate any help. Thanks!
trigger SetTaskTypeToEmail on Task (before insert) { For (Task nc:Trigger.new) { String subject = nc.Subject; String description = nc.Description; If( subject != null && subject.startsWith('Email:') && description.startsWith('Additional To:')) { nc.Type = 'Email'; } } }
All Answers
Beth