Guest User

Untitled

a guest
Dec 11th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. //A Utility class to process Stock Item records from the Stock Item Handler
  2. public with sharing class StockItemHandler {
  3.  
  4.  
  5. public static list<Stock_Item__c> getLowStockInventory(){
  6. //Query items where stock on hand is less than the minimum stock level
  7. List<Stock_Item__c> lowInventory = [Select id,name,Item_Name__c,Item_Stock_Is_Low__c,Minimum_Stock_Level__c,Stock_On_Hand__c from Stock_Item__c where Item_Stock_Is_Low__c=true];
  8. system.debug('Low Inventory Count: '+lowInventory.size());
  9. return(lowInventory);
  10.  
  11. }
  12.  
  13. //Create methods here to handle the before insert, before delete and utility processes described in the requirements
  14. //They should accept lists of Stock_Item__c records from the trigger
  15.  
  16.  
  17. }
Add Comment
Please, Sign In to add comment