Controlling reservations for warehouse management enabled items (WHS) – Part 1

By Lennart Conrad,  Microsoft

This blog posting describes how you can make small code modifications to control how reservations will be handled.

The WHS reservation system makes it possible to do reservations on different levels which represents how specific inventory dimension are used. By associating a reservation hierarchy with an item, the hierarchy levels are used to control which inventory dimensions will be used for a reservation and when these dimensions needs to be assigned to the inventory transactions.

Readers are assumed to be familiar with the WHS reservation system and have knowledge about the reservation hierarchies and the new ways of calculating on-hand. If a brush up on the details about the reservation system is needed, the below resources can be useful:

We have received several different questions around how the rules about which levels the reservation should include, can be changed. Here are some of the scenarios we have heard of and replied to:

  • I always want my production orders to reserve on all the dimensions IF the location is specified 
  • I am rolling out WHS processes one warehouse at a time and want to have a WHS setup but  I want to control if the reservation includes all dimensions or not based on the warehouse in order to use the old WMS picking system for the transition period
  • I want my sales order taker to be able to reserve on all dimensions IF they specify the serial number for an item that has serial below location

The good news is that these requirements can quite easily be supported with minor modifications.

This blog post will describe how the WHS reservation strategies are determined and explain where in the code changes need to be made to achieve a different behavior.

Reservation strategies Currently the below strategies are supported. The ‘Above Location’ and ‘All’ are the main ones that impact most scenarios. The following table gives a short description of all the strategies.

Reservation strategy

Description 

None The reservation is made on the dimensions that are passed, if possible. This strategy is used by inventory blocking, and lets you make reservations on, for example, the site level or the warehouse level.
All The reservation is made on all of the dimensions in the reservation hierarchy. This strategy is used, for example, for transfer journals, or for warehouses that have not been enabled for warehouse management processes.
Above location

The reservation is made only on the dimensions above the location level. This strategy is used, for example, for sales and transfer orders when reservations are made in a warehouse that is enabled for warehouse management processes.

All not allowed blank The reservation is made on the first lowest level that does not allow for blank issue for the inventory dimensions. This strategy enables automatic reservations on non-license-plate-controlled locations.
Batch level This strategy is applied for items for which the Batch number dimension is selected and positioned above the Location dimension in the reservation hierarchy. This strategy is used when only reservations that are reserved ordered can be made. In that case, a reservation until the batch level is attempted.

The system will use the reservation strategy ‘Above Location’ when the following criteria’s are met:

  • The line for which the reservation is made can have reserved work. This is for example production lines, sales lines and transfer order lines.
  • The warehouse is either not specified or it is a warehouse enabled for Warehouse management processes

The reason for choosing the ‘Above Location’ strategy when the above criteria are met, is that a reservation above location is needed in order to create work.

If the reservation includes any dimensions at or below the location,the work cannot be created. This is to avoid a double reservation since work has its own inventory transactions. This subject is described in more details in  White paper - Reservations in Warehouse management AX 2012 R3 (http://www.microsoft.com/en-gb/download/details.aspx?id=43284).

If the system does not choose the ‘Above Location’ strategy, it will choose reservation strategies that can results in a reservation on all the physical dimensions. 

If batch number is active in the items storage dimension group and above the location in the hierarchy the Batch level strategy is applied. 

Modifying code to change the above behavior

In order to change the decision on whether to reserve above location, different methods can be changed.

The main decision is made in the determinePhysicalStrategyTypesMovement method which looks as below

\Classes\WHSReservationHierarchyLevelStrategy\determinePhysicalStrategyTypesMovement

private static container determinePhysicalStrategyTypesMovement(
    InventMovement _movement,
    InventDim _inventDimReservationCriteria)
{
    container strategyTypes;
 
    if (_movement.canHaveReservedWork()
    && (!_inventDimReservationCriteria.InventLocationId
    || InventLocation::find(_inventDimReservationCriteria.InventLocationId).whsEnabled))
    {
        strategyTypes = [WHSReservationHierarchyLevelStrategyType::AboveLocation];
    }
    else
    {
        strategyTypes = [WHSReservationHierarchyLevelStrategyType::All,
                        WHSReservationHierarchyLevelStrategyType::AllNotAllowedBlank];
    }
 
    return strategyTypes;
}

If the goal is to have a specific movement type do a reservation on all dimensions one option is to override the canHaveReservedWork() method on that movement type.

The below is an example where the method is overridden for the sales lines movement to control that reservation occurs on all dimensions, if any dimensions below or at the location level is specified. E.g. if the location is specified on the sales line then the reservation will happen on all dimensions. 

public boolean canHaveReservedWork() 
{
    return this.isItemWHSEnabled() && salesOrderLine.inventDimAllowsWHSProcessing();
}

If the desire is to have a change that affects all movements types, then the first If block could be extended.

Two other methods are important to pay attention to if a modification is done:

\Classes\InventMovement\getInventDimForIssueTransFromReceipt

This method is called when a receipt is updated and a related issue transaction needs to be updated as a consequence. An example could be a sales order line that is reserved ordered against a purchase line.

When the purchase order line is updated with dimensions, only dimensions above the location will be transferred if the movement is one for which work can be created.

\Classes\InventMovement\getInventDimForReservedTransPhysChange

This method is called when a receipt is updated to a status that impacts the physical inventory and a related issue transaction needs to be updated as a consequence.

An example could be a sales order line that is reserved ordered against a purchase order lines transactions. When the purchase order line is registered with all the physical dimensions, only dimensions above the location will be transferred if the movement is one for which work can be created.

With modifications to one or more of the above mentioned methods it is possible to control if the reservation will be made on dimensions above the location or on all dimensions by using the existing reservation strategies.

It is also possible to introduce new reservation strategies and thereby get different control on the levels that the reservations are made on. An example could be a reservation strategy that only reserves on the Site level. Such modifications will be covered in future blog 

As a final comment, then remember that the code is "alive and breathing", so changes can and will occur as new hotfixes and updates are released. Hence, you should always verify if the usage of the methods covered here have been extended which means that other updates could be needed.

Please don't hesitate to provide us feedback on this posting and the reservation system in general! 

Related
Recommended