Created
June 27, 2018 23:05
-
-
Save choudharymanish8585/da6d066cd113e984db6095ea880ba38c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountController { | |
@AuraEnabled | |
public static List<Account> getAccountsWithOffset(String pageSize, String pageNumber){ | |
Integer ps = Integer.valueOf(pageSize); | |
Integer pn = Integer.valueOf(pageNumber)-1; | |
List<Account> accounts = [SELECT | |
Id, Name, Phone, Rating, My_Custom_Field__c, Active__c | |
FROM Account LIMIT :Integer.valueOf(ps) OFFSET :(ps*pn)]; | |
return accounts; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment