Skip to main content
Question

Auto Trigger Set Qty Works in Receive Mode but Not in Put Away Mode – Receive and Put Away Screen

  • January 16, 2026
  • 1 reply
  • 24 views

I am facing an issue with a customization on the Receive and Put Away screen related to automatically triggering the Set Qty action, and I would appreciate your guidance.

Screen

Receive and Put Away (PO302020)

Issue Description

I have implemented custom logic to automatically trigger the Set Qty action after scanning an item.

In Receive mode, the functionality works as expected.

After scanning the item, the Set Qty state is triggered automatically, and the system prompts the user to enter the quantity.

In Put Away mode, the same logic does not work.

 

Expected Behavior

In Put Away mode, after scanning the item and location as per flow, the system should automatically trigger the Set Qty action and prompt the user to enter the quantity.

 

Customization Code Reference

using System;

using System.Collections;

using PX.Data;

using PX.BarcodeProcessing;

using PX.Objects.IN;

using PX.Objects.PO.WMS;

 

namespace PX.Objects.PO.WMS

{

    public class ReceivePutAwayExt_ASetQtyExt 

        : PXGraphExtension<ReceivePutAway, ReceivePutAway.Host>

    {

        public static bool IsActive() => true;

 

        public class AutoQtyState : ReceivePutAway.EntityState<decimal?>

        {

            public BarcodeQtySupport<ReceivePutAway, ReceivePutAway.Host> QtyBase =>

                BarcodeQtySupport<ReceivePutAway, ReceivePutAway.Host>.GetSelf(Basis);

 

            public override string Code => "AUTOQTY";

            protected override string StatePrompt => "Enter the quantity.";

 

            protected override decimal? GetByBarcode(string barcode)

            {

                if (decimal.TryParse(barcode, out decimal qty))

                    return qty;

 

                return 1m;

            }

 

            protected override void Apply(decimal? value)

            {

                QtyBase.QtySetter.WithEventFiring

                    .Set(x => x.Qty, value ?? 1m);

            }

        }

 

        [PXOverride]

        public virtual ScanMode<ReceivePutAway> DecorateScanMode(

            ScanMode<ReceivePutAway> original,

            Func<ScanMode<ReceivePutAway>, ScanMode<ReceivePutAway>> baseMethod)

        {

            var mode = baseMethod(original);

 

            // RECEIVE MODE – WORKING AS EXPECTED

            if (mode is ReceivePutAway.ReceiveMode receiveMode)

            {

                receiveMode.Intercept.CreateStates.ByAppend(

                    b => new[] { new AutoQtyState() }

                );

 

                receiveMode.Intercept.CreateTransitions.ByReplace(basis =>

                    Base1.StateFlow(flow => flow

                        .From<ReceivePutAway.RefNbrState<POReceipt>>()

                        .NextTo<ReceivePutAway.InventoryItemState>()

                        .NextTo<AutoQtyState>()

                        .NextTo<ReceivePutAway.LocationState>()

                        .NextTo<ReceivePutAway.LotSerialState>()

                        .NextTo<ReceivePutAway.ExpireDateState>()

                        .NextTo<ReceivePutAway.ReceiveMode.ConfirmState>()

                    )

                );

            }

 

            // PUT AWAY MODE

            if (mode is ReceivePutAway.PutAwayMode putAwayMode)

            {

                putAwayMode.Intercept.CreateStates.ByAppend(

                    b => new[] { new AutoQtyState() }

                );

 

                putAwayMode.Intercept.CreateTransitions.ByReplace(basis =>

                    Base1.StateFlow(flow => flow

                        .From<ReceivePutAway.InventoryItemState>()

                        .NextTo<ReceivePutAway.LotSerialState>()

                        .NextTo<ReceivePutAway.LocationState>()

                        .NextTo<AutoQtyState>()

                        .NextTo<ReceivePutAway.PutAwayMode.ConfirmState>()

                    )

                );

            }

 

            return mode;

        }

    }

}

Please let me know if additional details required.

1 reply

Forum|alt.badge.img

@purva59 Auto Qty cannot be triggered as a Scan State in Put Away mode due to the below code.

 

Unlike Receive mode:

  • Put Away never asks for Qty via state flow

  • Qty is not a ScanState

  • Qty is handled outside the state machine

So adding:
.NextTo<AutoQtyState>()

Will never execute, regardless of transition order.
 

Where quantity really comes from in Put Away mode
The truth is in ConfirmState.Logic.ProcessPutAway():
 

decimal qty = Sign.MinusIf(remove) * Basis.BaseQty;  as shown in the first screenshot.

Qty source = Basis.BaseQty

So, Auto-set Qty before ConfirmState executes

override FlowStatus ProcessPutAway()

public override FlowStatus ProcessPutAway()
    {
        if (Basis.BaseQty <= 0)
            Basis.BaseQty = 1m;

        return base.ProcessPutAway();
    }