0

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.

1
  • 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 '21 at 18:07
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.