You need to sign in to do that
Don't have an account?
Error: Compile Error: Variable does not exist
Could somebody please explain to me why I'm getting this error? I want to extract the Comment from the CaseComment entity if was just recently added to the ase
trigger UpdateCaseCom on Task (after insert)
{
String LastCaseComment; Datetime DateFilter = Datetime.now().addSeconds(-30);
for (CaseComment cc : [select id, CommentBody, CreatedDate from CaseComment where CreatedDate >: DateFilter]);
{
LastCaseComment = cc.CommentBody;
}
for (Task t : [select Description, Type, Subject, isclosed, status, WhatId from task where Id in :Trigger.new]) {
Hi Simon
Thanks for that but now I getting a new error:
Error: Compile Error: Invalid field CommentBody for SObject Case at line 8 column 23 trigger
UpdateCaseCom on Task (after insert)
{
String LastCaseComment;
Datetime DateFilter = Datetime.now().addSeconds(30);
for (Case dc : [Select id, CommentBody, CreatedDate from CaseComment where CreatedDate >: DateFilter])
{
LastCaseComment = dc.CommentBody;
}