
Can you reccommend a way to update this field? Is this a cross-object formula that would require an apex trigger?
Thank you!
1 answer
Hi Orian,
A cross-object formula won't work for this because Lead Owner is a field that needs to be updated, not just calculated.
Since the email activity is being created by iHance, an Apex trigger on Task would be a good option. When a Task is created:
- Check whether Task.WhatId is a Lead.
- Check whether the Lead is currently owned by a Queue.
- If so, use Task.OwnerId to update the Lead's OwnerId.
- Make sure the trigger is bulkified since iHance may create multiple activities at once.
You could also use Workflow/Process automation if the required Task and Lead fields are available, but Apex gives you more control over the queue check and owner update.
If you can share how iHance populates the Task fields, especially OwnerId and WhoId/WhatId, the exact trigger logic can be determined.