+ Start a Discussion
Dave BrewerDave Brewer 

Custom Task Field Autopopulation

I've added a couple Custom Fields to the Activities object and are specifically used for Tasks. What I would like the fields to do is draw in information from the associated Lead/Contact that is chosen for the Task, but I'm not sure how to handle this. I have little-to-no Apex coding experience but know that this is probably something that could be solved using Apex. Could someone either point me in the general direction of a solution to this problem or help me to figure one out myself?
StephenKennyStephenKenny
Hi Dave,

As activities can have any record as a parent -  Account, Contact, Case etc.. You wont be able to achieve this using a workflow rule, but will have to use a trigger instead.

Given you do not have any experience writing code, this might be a bit tricky for you but by no means inpossible. In fact, this would be quite a good learing exercise for you. There will also be plenty pf people to help you should you come stuck.

There are some good links below to help hget you started.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_HelloWorld.htm
https://developer.salesforce.com/trailhead/apex_triggers/apex_triggers_intro

Regards
Stephen