function readOnly(count){ }
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 AutoCreateTask on Contact (after insert ) { system.debug('into contact trigger'); list<task> tasklist = new list<task>(); for(contact con : trigger.new){ Task tsk = new Task(); tsk.whoId=con.id; tsk.Status = 'In Progress'; tsk.Subject='call'; tsk.Priority = 'High'; tsk.ownerid= con.ownerid; tasklist.add(tsk); system.debug('task list'+tasklist); } if(!tasklist.isEmpty()){ try{ insert tasklist; }catch(DmlException de){ System.debug(de); } } }
The code can be as below.
If this solution helps, Please mark it as best answer.
Thanks,