You need to sign in to do that
Don't have an account?
Ghanashyam
How to read the Cases list?
Hi,
The following is a snippet of code I got from the VisualForce manual.
public class dataTableCon {
List<Account> accounts;
public List<Account> getAccounts() {
if(accounts == null) accounts = [select name, owner.name from account];
return accounts;
}
}
List<Account> accounts;
public List<Account> getAccounts() {
if(accounts == null) accounts = [select name, owner.name from account];
return accounts;
}
}
I understand that the method getAccounts() reads the account information and stores them in an account list namely accounts.
Similarly is it possible to read a list of 'case' information and store them in a case list? I mean... can someone tell me the equivalent of the below code... I tried the same and it didn't work:(!
public class dataTableCon {
List<Case> cases;
public List<Case> getCases() {
if(cases == null) cases = [select CaseNumber, ContactId from Case];
return cases;
}
}
List<Case> cases;
public List<Case> getCases() {
if(cases == null) cases = [select CaseNumber, ContactId from Case];
return cases;
}
}
Many thanks
Ghanashyam
how did you test it?
do you have any cases?