You need to sign in to do that
Don't have an account?
Mallik Vemugunta
Initial term of field expression must be a concrete SObject
I am getting Initial term of field expression must be a concrete SObject: LIST<Merchandise__c>error
for the following code, please help
List<Account> accts = [SELECT Id, Name from Account]; ==> This is the line
System.debug(accts.size);
for(Account a : accts) {
System.debug('First Account Id: ' + a.Id);
System.debug('First Account Name: ' + a.Name);
}
for the following code, please help
List<Account> accts = [SELECT Id, Name from Account]; ==> This is the line
System.debug(accts.size);
for(Account a : accts) {
System.debug('First Account Id: ' + a.Id);
System.debug('First Account Name: ' + a.Name);
}
The problem is with system debug in second line.
It is not with the query,just change the System.debug(accts.size); to
this System.debug(accts.size()); thats it.
Thanks
Anil.B
Please use below code :
List<Account> accts = [SELECT Id, Name from Account]; ==> This is the line
System.debug(accts.size());
for(Account a : accts) {
System.debug('First Account Id: ' + a.Id);
System.debug('First Account Name: ' + a.Name);
}
List<Account> accts = [SELECT Id, Name from Account];
System.debug(accts.size());
for(Account a : accts) {
System.debug('First Account Id: ' + a.Id);
System.debug('First Account Name: ' + a.Name);
}