You need to sign in to do that
Don't have an account?
Linking Tasks to Accounts - when using Apex triggers
Hi,
I am trying to create a task on creation of an account in a specific industry.
When I try to link the account and Task by putting the account id in the WhoID field of the task, I get a exception when the trigger fires.
CreateTaskWhenAccountCreated: execution of AfterInsert
caused by: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Contact/Lead ID: id value of incorrect type: 0014000000NKcUBAA1: [WhoId]
Trigger.CreateTaskWhenAccountCreated: line 46, column 1
How do I link a task to an Account differently to avoid getting this exception?
Thanks!!