I'm trying to debug this method on the developer console:

string groupId='';
List <String> selectedUsers='';
List <String> updatedUsers='';
Boolean userUpdatedBool=false;

UsersController.addRemoveUsers(groupId,List selectedUsers,List updatedUsers,

but I get this error popup: Title: Execute Anonymous Error, Error: Line: 7, Column: 31 Unexpected token '('.

does anyone know how should I write this, so the developer console can accept it? Previously I was debugging another this method: string userId=''; UsersController.fetchUsers (userId); with one String parameter and it was working perfectly, but now that I have List parameters and more than one I can't make it work.

  • 1
    Please edit your question to include the exact text of the error that you're getting. It could be as simple as "you need to declare variables before you use them", but knowing the exact error message can help take out a lot of guesswork.
    – Derek F
    Oct 5, 2021 at 18:07

1 Answer 1


You're writing the code as if you were trying to declare a parameter list. You need to actually pass in data:

String groupId = '...';
String[] selectedUsers = new String[] { '005...','005...' };
String[] updatedUsers = new String[] { '...', '...' };
Boolean userUpdatedBool = false;
UsersController.addRemoveUsers (groupId, selectedUsers, updatedUsers, userUpdatedBool);

Adjust your inputs as necessary.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .