You need to sign in to do that
Don't have an account?

Task information on a Lead
Good afternoon!! I am trying to create an Apex trigger so when someone enters comments into the Task comments section (Description), those comments are also entered into the history comments section (History_Comments__c) on the Lead. I would like it so each time a Task is closed, the comments for that Task are entered onto a new line in the history comments section.
So it would look like this in the history on the Lead (the comments would be what is entered onto the Task) :
Talked to the borrower, they stated they were not interested
Borrower called back, stated they in fact interested in our product
Borrower called back again, stated he in fact hates our product and hopes it falls into the ocean
I hope this makes sense
Thank you for your time!
Rob
This shouldn't be that difficult. Here's what I would do:
This assumes it's okay to blank out the Description field each time. This isn't too bad an idea; if you don't give the user access to edit the History Comments field, this would be a convenient one-look way to see history. Also, just add Userinfo.getName() and system.now() into the string, and you can see who wrote what when.
Good luck,
Jeremy
That is great! I will try it out. Now to test the trigger, I have what is below, but it does not seem to be working and I am sure I am missing something here :
@isTest
Task task = new Task () {
task.Description =
insert
insert
}
}
task;private class CopyLeadInformation { void myTest() {
statictestMethod void myTest () {
Task
task = new Task ();task.WhoId = lead.id;
When you copy your code over, use the little Code Insert button (has a C on it), that will put it into a formatted box. I can't really tell what your code is doing.
Thanks,
Jeremy