You need to sign in to do that
Don't have an account?
TheMaryC
Update custom lead field based on a custom activity field
I have a custom field (EmailCount) on the Activity tab that gives me a count of certain types of activities. What I would like is for this field to be populated onto the Lead tab into another custom field (EmailCountLead).
I would have liked have done this through work rules, but I don't see the needed fields.
Thanks
I tried the workflow rule for the similar reason, and it seems like it only allows field update for the related objects. I guess Activity isn't related to Account, therefore fields in Account do not show up in field update.
I'm a newbie myself, so I can't give you the perfect solution, but I would just write a trigger. Something like this...
trigger <name of the trigger> on Task (after update) {
for (Task updatedTask : trigger.new) {
for(Account a : [SELECT id, EmailCountLead__c FROM Account WHERE Account.id =:updatedTask.AccountId]){
a.EmailCountLead__c = updatedTask.EmailCount__c;
update a;
}
}
}
Oops sorry, you said Lead, not account. THe above code I wrote assumed the custom field is in account...
I don't think there is any reference in task that links to Lead... meaning there isn't any connection between task sobject and lead sobject. I hope other people can help you about this. I'm leaving my other post just in case.