• Jeanne Jobes 1
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
public class StockListController {
    
public List<Stock_Item__c> getStockItems() {
    
    List<Stock_Item__c> results = Database.query(
        'SELECT ID, 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'
    );
    return results;
}
}    



<apex:page lightningStyleSheets="true" Controller="StockListController">
    <apex:form>
        <apex:pageBlock title="Low Stock Items" id="stock_item_list">
            
            <!-- Stock Item List goes here -->
            <apex:pageBlockTable value="{! StockItems }" var="si">
                <apex:column value="{! si.ID }"/>
                <apex:column value="{! si.Item_Name__c }"/>
                <apex:column value="{! si.Item_Stock_is_Low__c }"/>
                <apex:column value="{! si.Minimum_Stock_Level__c }"/>
                <apex:column value="{! si.Stock_on_Hand__c }"/>
    
</apex:pageBlockTable>
            
        </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image