- Mahesh Reddy 72
- NEWBIE
- 0 Points
- Member since 2016
- Salesforce Developer
- Web patashala solutions pvt ltd
-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
4Questions
-
0Replies
System.QueryException: unexpected token: By
i facing this type of error in my class,
System.QueryException: unexpected token: By
Class.PaginatoinExampleProgramForJob.__sfdc_setCon: line 9, column 1
Class.PaginatoinExampleProgramForJob.getAccounts: line 18, column 1
And under this is my class
public class PaginatoinExampleProgramForJob {
Public integer noOfRecords{set; get;}
public integer size{set; get;}
public Apexpages.StandardSetController setCon{
get{
if(setCon == null){
size=10;
string query='SELECT Name, Type, Billingcity, Billingstate, BillingCountry FROM Account Ordered By Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(query));
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
}
return setCon;
}set;
}
public list<Account> getAccounts(){
list<Account> acclist=new list<Account>();
for(Account a :(list<Account>)setCon.getRecords())
accList.add(a);
return accList;
}
public PageReference refresh(){
setCon = null;
getAccounts();
setCon.setPAgenumber(1);
return null;
}
}
System.QueryException: unexpected token: By
Class.PaginatoinExampleProgramForJob.__sfdc_setCon: line 9, column 1
Class.PaginatoinExampleProgramForJob.getAccounts: line 18, column 1
And under this is my class
public class PaginatoinExampleProgramForJob {
Public integer noOfRecords{set; get;}
public integer size{set; get;}
public Apexpages.StandardSetController setCon{
get{
if(setCon == null){
size=10;
string query='SELECT Name, Type, Billingcity, Billingstate, BillingCountry FROM Account Ordered By Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(query));
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
}
return setCon;
}set;
}
public list<Account> getAccounts(){
list<Account> acclist=new list<Account>();
for(Account a :(list<Account>)setCon.getRecords())
accList.add(a);
return accList;
}
public PageReference refresh(){
setCon = null;
getAccounts();
setCon.setPAgenumber(1);
return null;
}
}
- Mahesh Reddy 72
- August 18, 2016
- Like
- 0
- Continue reading or reply