Apex SObject row was retrieved via SOQL without querying the requested fieldの解決方法
環境
Apex Salesforce
エラー現象
SObject row was retrieved via SOQL without querying the requested field xxx
エラーの解決策
List<Acccount> acc = [SELECT Id,Name FROM ACCOUNT];
String accName = acc.Name;
List<Account> acct = [SELECt Id,Name FROM ACCOUNT];
String accName = acct.Name