function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TheresaAndersonTheresaAnderson 

I need a trigger to copy the contents of a comment field on an Account record

I'm looking for a trigger that will copy the contents of a comment field on the account record and paste into the new task that is created through a workflow rule. 

 

Does anyone have an example?

Rahul SharmaRahul Sharma

Can't you add one more field update to workflow which is responsible for creating the task's?

TheresaAndersonTheresaAnderson

Well, the comment I want to capture is on the account record.  If I could update the Task comment dynamically from the account comment, I am all ears.    The field update is limited to the account record since the workflow rule is assigned to the account object.

TheresaAndersonTheresaAnderson

I am seeing a posted idea in Salesforce to allow cross object functionality in Workflow rules.  SF is working on the feature.  In the meantime, I need a work around solution.

Rahul SharmaRahul Sharma

I think you would then need a trigger on task which will fire when the task was created from Account.

And it will simply copy the Account.comment to the desired task field.