You need to sign in to do that
Don't have an account?
Andréa de Faria
Copy field from Task to Event with same Contact
Hello,
In our company, the Task object have a field called "Meeting Notes", which is the standard "Description" Text field of the Task object, but with the label "Meeting Notes".
Please, how can I copy the value from this field in the most recent Taks created and paste it in a custom Event field called "Pre Meetin Notes".
This Event will also be the latest one created.
The Task and the Event will have the same Contact in common.
I tried with Process Builder and formula fields, but none of these worked.
Appreciate your help.
In our company, the Task object have a field called "Meeting Notes", which is the standard "Description" Text field of the Task object, but with the label "Meeting Notes".
Please, how can I copy the value from this field in the most recent Taks created and paste it in a custom Event field called "Pre Meetin Notes".
This Event will also be the latest one created.
The Task and the Event will have the same Contact in common.
I tried with Process Builder and formula fields, but none of these worked.
Appreciate your help.
I have used a lightning flow to achieve it. We are using record trigger flow and only in create scenerio. When ever a new event is created it will copy the description field from the latest task which is associted to the contact.
Record Trigger flow starting condition:
get associated latest event:
Update the task description:
Entire Flow:
Let me know if you need any help on it.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
What should be the behaviour if the contact has multiple events. On which Event record I should populate the field. Is that okay to use the APEX in the above requirement or you want it using some lightning flows.
Thanks,
I have used a lightning flow to achieve it. We are using record trigger flow and only in create scenerio. When ever a new event is created it will copy the description field from the latest task which is associted to the contact.
Record Trigger flow starting condition:
get associated latest event:
Update the task description:
Entire Flow:
Let me know if you need any help on it.
If this solution helps, Please mark it as best answer.
Thanks,
it will work through the triggers:
Example:
trigger tasktrigger on Task (after insert) {
if(trigger.Isafter && trigger.ISinsert){
CopyField.copytaskfield(trigger.new);
}
}
Apex handler:
public class CopyField {
public static void copytaskfield(List<Task> tasklist){
List<Event> eventlist = new List<Event>();
for(task obj:tasklist){
Event eventobj = new Event();
eventobj.WhoId= obj.WhoId;
eventobj.Description = obj.Description;
eventobj.ActivityDate = date.today();
eventobj.DurationInMinutes=20;
eventobj.ActivityDateTime = date.today();
eventlist.add(eventobj);
}
insert eventlist;
}
}
Or you can use flow for this.
hope this will help you.
Thanks.
@Sai Praveen, your flow worked perfectly!!!!!!
@Suraj Tripathi 47, I'm not so familiar with triggers, but thank you for your detailed answer!