You need to sign in to do that
Don't have an account?
dcgb2332
Auto-Populate Created By field in Task object with Assigned to User (name)
When a task is created, I have a custom pick list on a custom field (Assigned To). I would like that information to populate the Created By field, with an Apex Trigger but am not sure how to start the code
All Answers
Thanks so much! Unfortunately it isn't working:
The "Task Assigned to" is meant to match the "Assigned to User" field, nothing happened with the trigger you shared.
Is it the verbiage that is potentially needing to change?
Thank you!!
trigger Created_By on Task (before insert) {
for (Task taskRe :Trigger.New) {
taskRe.CreatedById = taskRe.OwnerId;
}
}
I needed the owner ID to match up with the created by ID; my API names were off.
Thanks so much!!