Write a method with more than one parameter in the Developer Console

debuggingdeveloper-console

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,
userUpdatedBool);

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.

Best Answer

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.