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

After Insert/Update triggers broken
I've been using the following trigger in production for about 5 months with no issues and all of a sudden today I'm getting the following errors:
Apex script unhandled trigger exception by user/organization: DeploymentOrderIsVerified: execution of AfterUpdate caused by: System.ListException: List index out of bounds: 0 Trigger.DeploymentOrderIsVerified: line 10, column 41
The code block the error is referring too is as follows:
/**
* Fires when the Deployment Order IsVerfied flag is set to true.
* Child Lease Field Updates:
* -IsVerified__c = TRUE
* -NextStep__c = 'Awaiting Funding'
*/
trigger DeploymentOrderIsVerified on DeploymentOrder__c (after insert, after update)
{
DeploymentOrder__c olddo;
DeploymentOrder__c newdo = Trigger.new[0];
How would I get a ListException error referencing the first item in Trigger.new on an after insert/after update trigger?
Turns out another admin added a lookup filter to one of our fields which was generating an error on save. For whatever reason that wasn't showing in the debug logs though ... really odd.
Either way the trigger is firing properly again ... Thanks for the help ...
All Answers
Yup, that is bizzare. It seems like this shouldn't be possible. If the list trigger.new is trully empty the trigger should have never fired as there was nothing to fire it. Do you get this error everytime? Only inserts, only updates?
I'm curious what this outputs:
system.debug(trigger.new.size());
I would open a case on this one though.
Turns out another admin added a lookup filter to one of our fields which was generating an error on save. For whatever reason that wasn't showing in the debug logs though ... really odd.
Either way the trigger is firing properly again ... Thanks for the help ...