Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Terrible.cls
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,22 @@ return r;
return url;

}

public static PagedResult findAll(String searchKey, Decimal minAlcohol, Decimal pageNumber) {
Integer pageSize = 12;
String key = '%' + searchKey + '%';
Integer offset = ((Integer)pageNumber - 1) * pageSize;

PagedResult r = new PagedResult();

r.products = [SELECT Id, Name, Alcohol__c, Tags__c, Brewery__r.Name, Image__c FROM Beer__c
WHERE (Name LIKE :key OR Brewery__r.Name LIKE :key OR Tags__c LIKE :key ) WITH SECURITY_ENFORCED
AND Alcohol__c >= :minAlcohol
ORDER BY NAME LIMIT 12 OFFSET :offset];
System.debug(r);
return r;
}
//Trigger
//END:: 08/06/2017 New Lightning UI Added by Ranjeet

}