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

Populating a task field from related account
I'm capturing the date a sales rep accepts a lead into their funnel using a Date_Accepted__c field on the account. I want to map this to a Date_Accepted__c field all tasks associated with the account. I've tried doing this with a formula field and a workflow and was unable to do it because Task is not a child of Account. Is there an apex trigger I could use to map this date from account to task?
[select Date_Accepted__c from task where id=:accountid ];
All Answers
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger Triggertask caused an unexpected exception, contact your administrator: Triggertask: execution of BeforeInsert caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Account.Date_Accepted__c: Trigger.Triggertask: line 17, column 1
[select Date_Accepted__c from task where id=:accountid ];
Can you help me create a test for these?
Thanks,
Itay