0

Getting this error: Error: Compile Error: unexpected token: 'List'

 public String SupportTierValue {
  get {


    List tmpAcct = [SELECT Id, Name, Support_Tier__c
    FROM Account
    WHERE Id IN 
    (SELECT AccountId 
    FROM user 
    WHERE username=:UserInfo.getUsername()
    )
    LIMIT 1
    ];
    if (tmpAcct.size() > 0) {
    String SupportTier = tmpAcct[0].Support_Tier__c;
    }
    else {
    String SupportTier = 'SomeDefaultValue';
    }



}
return SupportTierValue;
 }
private set;

}
2

List requires a "specialization", such as List<Account> in your code example.

|improve this answer|||||
  • Thank you. Now I get an error : Error: Compile Error: expecting right curly bracket, found 'return' . I tried the right curly bracket and nothing – ObiDarrell Jun 8 '17 at 16:12
  • @ObiDarrell the } before the return statement is unbalanced. Remove that one from your code. – sfdcfox Jun 8 '17 at 16:46

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