Created
October 18, 2018 20:46
-
-
Save choudharymanish8585/c0e25911f328147e9929da66fb68fa7e 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