About this question
I have made this list and it's supposed to return all the users that are active but I don't know why the for loop is wrong. Do I need a Set?
public with sharing class ActiveAgents { public ActiveAgents() { User U = new User(); ListActiveUser = [SELECT Name , UserName, LastName FROM User WHERE IsActive = true]; for (User currentUser : ActiveUser) { U.add(currentUser.Name); U.add(currentUser.Username); } } }