Skip to end of metadata
Go to start of metadata

In a marketing document, for example in a Delivery, it is possible to display the current stock levels of the item. To do this, set the In Stock field to Visible. This In Stock field displays the total current in stock quantity of the item, across all warehouses.  In the following example, the In Stock field shows a quantity of 17 for Item Code 038, Strawberry, on row level of delivery 188.

This In Stock quantity of 17 represents the total quantity currently in stock across all warehouses. The Item Master Data - Stock tab shows that this item has 7 units in warehouse 01 and 10 units in warehouse 02.

In many cases, both the item cost and quantity is managed by warehouse. This may be due to the physical location of the warehouse. In this scenario, the In Stock field does not show the total stock for the specified warehouse on row level. Instead, as previously stated, it shows the total stock for that item across all warehouses.

In order to display the stock levels in the warehouse specified on row level the following steps must be followed:

  1. Create a User Defined Field (UDF) on row level of the marketing document.

    To do this, use User Defined Field Management (Tools -> Customisation Tools -> User Defined Fields - Management)



  2. A query based formatted search (FMS) is required in order to select the quantity in stock for the specific warehouse in the newly created UDF. To do this:
    1. Save the following query to the Query Manager.

      SELECT T0.[OnHand] FROM OITW T0 WHERE T0.[WhsCode] = $[$38.24.0] and T0.itemcode = $[$38.1.0]
      

    2. Open the Delivery document, click into the UDF.
    3. Go to Tools -> Customization Tools -> User Defined Values - Setup or use ALT +SHIFT + F2.
    4. In this screen, select the option Search in Existing User-Defined Values According to Saved Query.



    5. The query from point a above can now be selected. To do this, double-click on the grey box to open the Query Manager and select the saved query.



    6. To automatically activate the FMS, in the document, click the checkbox Auto Refresh and choose When Exiting Altered Column. In the white box, select the black drop down arrow and choose the field which will activate the FMS. In this example, the Item No. field is chosen because the in stock quantity should be visible before entering any value in the Quantity field of the document. Finally, select the option Display Saved User-Defined Values. Click on update to save the FMS.



  3. Now, when selecting an item on row level of a delivery, the in stock quantity for the warehouse specified on row level is displayed. For example, Delivery No. 189 is created for Item No._038. The UDF _WHSE Quantity displays a quantity of 2. 



    This figure corresponds to the In Stock quantity for that warehouse as seen in the Item Master Data - Stock tab.