So With the following trigger I wrote, I get an error on the line that says Trigger.oldMap( t1.Id ).IsClosed
: The error is
"Variable does not exist: Trigger"
Which seems very odd to me, can anyone see what I'm doing wrong?
trigger TaskStatusChanged on Task ( after update ) {
// For all the tasks that have been updated
for( Task t1 : Trigger.new ) {
// If this task has been closed or opened
if( t1.IsClosed != Trigger.oldMap( t1.Id ).IsClosed ) {
// If the task has been closed
if( t1.IsClosed ) {
// Stuff
}
// If there aren't any other open tasks, then update the Case object.
if( !otherOpenTasks ) {
//Stuff
}
}
// If the task has been opened
else if( !t1.IsClosed ) {
// Stuff
}
// If the Task doesn't have an IsClosed value
else {
// do nothing
}
}
}
}