function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vbcrlfuservbcrlfuser 

APEX Bug / ApexPages.StdController ?

This bit of APEX used to simply show a picklist with all of the AccountTeamMembers for the account on the case being edited. Of which only one has been configured and there are only 28 members.

 

Now it shows virtually all of the SF user base regardless if they are AccountTeamMembers. Nothing has changed except the 09 upgrade.

 

Anybody see a bug here in my code? Or is this a SF bug?

 

 public class AccountTeamCaseTransferExt {

    private final Case c;

    String teamMember;
 
    public AccountTeamCaseTransferExt(ApexPages.StandardController stdController) {
        this.c = [SELECT Id, AccountID, OwnerId FROM Case WHERE Id = : stdController.getID()];
    }
 
    public PageReference transfer()
    {
    
        if (this.teamMember != NULL)
        {
            c.OwnerId = this.teamMember;
            update c;
            
        }
        
        PageReference pageRef = new PageReference('/' + c.Id);
        pageRef.setRedirect(true);
        return pageRef;
    }
    
    public List<selectOption> getTeamMembers()
    {
        
        List<selectOption> options = new List<selectOption>();
        options.Add(new selectOption('', '-- None --'));
        

        
        if (c.AccountId != NULL) {
            for (User u : [SELECT Id, Name FROM User WHERE Id IN ( SELECT UserId FROM AccountTeamMember WHERE AccountId = : c.AccountId) ORDER BY Name ASC] ) {
              options.Add(new selectOption(u.Id, u.Name));
            }
        }
        return options;
    }
    
    public String getTeamMember()
    {
        return this.teamMember;
    }
    
    public void setTeamMember(String s)
    {
        this.teamMember = s;
    }
     
}