Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. private List<Product2> performSearch(string searchString) {
  2.  
  3. String soql = 'Select Id, Name, PriceBook2Id, Product2Id, ProductCode from Pricebookentry where PriceBook2Id =: Qid';
  4.  
  5. if(searchString != '' && searchString != null){
  6. soql = soql + ' AND Product2.name LIKE '%' + searchString +'%' ';
  7. }
  8. if(BrandsearchString != '' && BrandsearchString != null){
  9. soql = soql + ' AND Product2.brand1__c LIKE '%' + BrandsearchString +'%' ';
  10. }
  11. if(GroupsearchString != '' && GroupsearchString != null){
  12. soql = soql + ' AND Product2.Group1__c LIKE '%' + GroupsearchString +'%' ';
  13. }
  14.  
  15. return database.query(soql);
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement