function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
varivari 

trigger error

Apex trigger Test2 caused an unexpected exception, contact your administrator: Test2: execution of BeforeUpdate caused by: System.ListException: List index out of bounds: 1: Trigger.Test2: line 63, column 1

 

can any one help me 

Axaykumar VaruAxaykumar Varu

Hi Vari,

 

verify the list size > 0 before you use the list indexing.

 

Thnks,

Axaykumar

Niket SFNiket SF
Just want to add +1 here.. you can check

If(!testList.IsEmpty())

Use standard list.Isempty() method.

Thank you
Nik's