You need to sign in to do that
Don't have an account?
Meaghan
Unexpected Token Error on Apex Trigger
Hi All -
I am hoping you can help. The trigger below is supposed to add a custom URL to our Case object after a Case record is created. I am receving an error that says "Unexepected Token: Update" for the last line: "update newlyInsertedItems;"
The error is showing up twice:
I also need any help that anyone could offer to create a test class for this - thank you all so much in advance!
trigger Case_Approved_List_URL on Case (after insert) {
//
if (trigger.isAfter && trigger.isInsert) {
List<Case> newlyInsertedItems = [SELECT Id , Approved_List_Form_URL__c FROM Case WHERE Id IN :trigger.new] ;
List<string> ids = new List<string>();
for ( Case e : newlyInsertedItems) {
ids.add(e.id);
}
VisualAntidote.FastFormsUtilities.DoUpdateRecords ( 'Case' , 'Approved_List_Form_URL__c' , '134562356426212345' , [//mycompany.secure.force.com] );
update newlyInsertedItems;
}
}
I am hoping you can help. The trigger below is supposed to add a custom URL to our Case object after a Case record is created. I am receving an error that says "Unexepected Token: Update" for the last line: "update newlyInsertedItems;"
The error is showing up twice:
I also need any help that anyone could offer to create a test class for this - thank you all so much in advance!
trigger Case_Approved_List_URL on Case (after insert) {
//
if (trigger.isAfter && trigger.isInsert) {
List<Case> newlyInsertedItems = [SELECT Id , Approved_List_Form_URL__c FROM Case WHERE Id IN :trigger.new] ;
List<string> ids = new List<string>();
for ( Case e : newlyInsertedItems) {
ids.add(e.id);
}
VisualAntidote.FastFormsUtilities.DoUpdateRecords ( 'Case' , 'Approved_List_Form_URL__c' , '134562356426212345' , [//mycompany.secure.force.com] );
update newlyInsertedItems;
}
}
What is the data type for the last parameter that you are passing in the method above the update statement?
If this is of String type than it should be enclosed in inverted commas like other parameters and if this is a list than it should be added in a list and than passed to the method.
Please correct that.
Thanks,
Abhishek Bansal