You need to sign in to do that
Don't have an account?
Simple APEX class won't save.
Hi. I am adding this APEX class referenced in the following article:
https://automationchampion.com/tag/auto-delete-record-using-process-builder/
It won't save because I'm getting the following error:
Error: Compile Error: Unexpected token 'List'. at line 6 column 9
Thank you for your help.
Code listed here:
public class DeleteUnaccepted
Quotes { @InvocableMethod
public static void QuoteDelete(List<Id> OpportunityIds)
{
List Quotes =[select id from quote
where Opportunity.id in :OpportunityIds
and Status != 'Accepted'];
delete Quotes;
}
}
Greetings!
The way of using List is incorrect in the above code.Can you please try by using the List as below:
List<Quotes> variable=[select id from quote
where Opportunity.id in :OpportunityIds
and Status != 'Accepted'];
delete variable;
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri