You need to sign in to do that
Don't have an account?
Raymond Mortu
trigger validation error
Hi Guys, i got this error validating my Trigger
System.ListException: List index out of bounds: 1 Stack Trace: Class.CaseUtility.updateExpiredPoaLinks: line 582, column 1 Class.CaseUtilty_test.testUpdateExpiredPoaLinks: line 192, column
code below:
need help
System.ListException: List index out of bounds: 1 Stack Trace: Class.CaseUtility.updateExpiredPoaLinks: line 582, column 1 Class.CaseUtilty_test.testUpdateExpiredPoaLinks: line 192, column
code below:
trigger t1 on Case (before insert, before update) { Group q = [SELECT Id FROM Group WHERE Name ='NCT queue' AND Type = 'Queue']; Contact con = new Contact(); for(Case cas : Trigger.New){ if(cas.Court_Process__c == 'NCT'){ cas.OwnerId = q.Id; } } NCT__c nctNew = new NCT__c(Full_Name__c = con.cm1__Full_Name__c ); insert nctNew; }
need help
The error doesn't seems to be in the trigger but in one related class like :
Class.CaseUtility.updateExpiredPoaLinks:
CaseUtilty_test.testUpdateExpiredPoaLinks
Please post the code lines that are raising errors.
This means that your query has returned no records that match the criteria. If you then attempt to access an element at row 2, this will throw an error as that row doesn't exist. Its good practice to check there are records first.
You need to share code for two methods mentioned in the error. 1) updateExpiredPoaLinks 2) testupdateExpiredPoaLinks
Regards,
Ramakant
thanks for helping out:
Method for Class.CaseUtility
Method for CaseUtilty_test.testUpdateExpiredPoaLinks
/*<b>Line 582</b>*/
wanted to point out the line numbers