You need to sign in to do that
Don't have an account?
Gauri Gaikwad 13
I am getting error as unexpected token :
//declare a list variable
list<integer> VarEmployeeList= New list<integer> ();
//add values
VarEmployeeList.add(123);
VarEmployeeList.add(1234);
VarEmployeeList.add(1234);
system.debug(VarEmployeeList);
For(VarOneValue: VarEmployeeList)
{
system.debug(VarOneValue);
}
list<integer> VarEmployeeList= New list<integer> ();
//add values
VarEmployeeList.add(123);
VarEmployeeList.add(1234);
VarEmployeeList.add(1234);
system.debug(VarEmployeeList);
For(VarOneValue: VarEmployeeList)
{
system.debug(VarOneValue);
}
You have error in the for loop. You have to iterate over the list of integers. So i guess the below code should work.
If this solution helps, please. mark it as best answer.
Thanks,