Skip to main content
Question

Adding new transition step to WMS

  • September 15, 2026
  • 6 replies
  • 30 views

Forum|alt.badge.img

Has anyone managed to sucessfully add a new barcode step to a WMS form. My code appeared to working fine, but replacing the transitions breaks the confirm package and confirm shipment buttons for some reason.

 

Basically in pick pack ship in pack mode, I need it to tell the user to scan a custom field value for the package. And it seems to works if I do this in a scanextension script:

 

[PXOverride]
public virtual ScanMode<PickPackShip> DecorateScanMode(ScanMode<PickPackShip> original, Func<ScanMode<PickPackShip>, ScanMode<PickPackShip>> base_DecorateScanMode)
{
    // Call the base code to get the original mode
    var mode = base_DecorateScanMode(original);

    //return mode;

      if (mode is PickPackShip.PackMode packMode)
      {

          packMode.Intercept.CreateStates.ByAppend(basis =>
              new ScanState<PickPackShip>[] { new BoxPackageTransferLabel() }
          );

        packMode
        // Replaces the previous implementation with a new one.
        .Intercept.CreateTransitions.ByReplace(basis =>
        {
            // Creates a list of sequential transitions.
            return basis.StateFlow(flow => flow
                .From<PickPackShip.PackMode.ShipmentState>()
                .NextTo<PickPackShip.PackMode.BoxState>()
                .NextTo<BoxPackageTransferLabel>() //inserted new state for scanning transfer label
                .NextTo<WMSBase.InventoryItemState>()
                .NextTo<WMSBase.LotSerialState>()
                .NextTo<PickPackShip.PackMode.ConfirmState>()
                .NextTo<CommandOrShipmentOnlyState>()
                );
        });

    }

    return mode;
}

 

Thar BoxTransferLabel step correctly reads a barcode, verifies it to an actual record and assigns it to the package record without issue. However when I go to press the confirm package or confirm shipment, it gets lost and gives a generic error. If I remove the createtransitions part entirely, standard works. If I just remove my new custom state and keep the rest of the replace, it still breaks. Acumatica documentation on this is so poor, there are no examples explaining it. I thought perhaps I could maybe do an append instead of replace, but there are zero examples of that either.

 

Has anyone managed to add a barcode scanning step without breaking the rest of the functionality?

 

Thanks.

Andrew

6 replies

JKurtz29
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • September 15, 2026

Here is the implementation code of one of my customizations that adds two new scans.  Different screen, but same idea.  It looks like your CreateStates.ByAppend isn’t returning anything.  It’s just declaring the new state.  See how mine is using .Append to add the new states:

Note:  I’m also have a section that resets one of the fields (the other is purposely not being cleared)
 

[PXOverride]
public virtual ScanMode<INScanCount> DecorateScanMode(
ScanMode<INScanCount> original,
Func<ScanMode<INScanCount>, ScanMode<INScanCount>> base_DecorateScanMode)
{
var mode = base_DecorateScanMode(original);

if (mode is INScanCount.CountMode iMode)
{
iMode.Intercept.CreateStates.ByAppend(basis =>
{
return iMode.States
.Append(new TagState())
.Append(new AreaState());
});

iMode.Intercept.ResetMode.ByAppend(basis =>
{
Basis.Clear<TagState>();
//Basis.Clear<AreaState>();
});

iMode.Intercept.CreateTransitions.ByReplace(basis =>
{
return basis.StateFlow(flow => flow
.From<INScanCount.CountMode.RefNbrState>()
.NextTo<AreaState>()
.NextTo<INScanCount.LocationState>()
.NextTo<INScanCount.InventoryItemState>()
.NextTo<INScanCount.LotSerialState>()
.NextTo<TagState>()
);
});
}

return mode;
}

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • September 15, 2026

Interesting. Looks a lot like what I did. I added the reset part and found a few extra transitions in the decompiled code. I’ll see if that works.

I wish I could just use Intercept.CreateTransitions.ByAppend instead to add the step more safely but I don’t see any documentation on that either.


JKurtz29
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • September 15, 2026

Interesting. Looks a lot like what I did. I added the reset part and found a few extra transitions in the decompiled code. I’ll see if that works.

I wish I could just use Intercept.CreateTransitions.ByAppend instead to add the step more safely but I don’t see any documentation on that either.

I noticed you’ve also added :

.NextTo<PickPackShip.PackMode.ConfirmState>()               

.NextTo<CommandOrShipmentOnlyState>()

I think confirm is implicitly called as the last step, so I don’t think you need to have that in there.  Not sure about that last one though.  I would maybe comment those two out too and see what happens.


Forum|alt.badge.img
  • Author
  • Freshman II
  • September 15, 2026

So I added new transitions I found in the decompiled code along with that reset part and it appears to work now. I’ll need to run more tests though. I was able to make two separate packages with the custom field filled out, confirm each package and confirm shipment.

 

packMode
// Replaces the previous implementation with a new one.
.Intercept.CreateTransitions.ByReplace(basis =>
{
    // Creates a list of sequential transitions.
    return basis.StateFlow(flow => flow
        .From<PackMode.ShipmentState>()
        .NextTo<PackMode.BoxState>()
        .NextTo<BoxPackageTransferLabel>() //inserted new state for scanning transfer label
        .NextTo<WMSBase.InventoryItemState>()
        .NextTo<WMSBase.LotSerialState>()
        .NextTo<PackMode.ConfirmState>()
        .NextTo<CommandOrShipmentOnlyState>()
        .NextTo<PackMode.BoxConfirming.StartState>()
        .NextTo<PackMode.BoxConfirming.WeightState>()
        .NextTo<PackMode.BoxConfirming.DimensionsState>()
        .NextTo<PackMode.BoxConfirming.CompleteState>()

        );
});


JKurtz29
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • September 15, 2026

So I added new transitions I found in the decompiled code along with that reset part and it appears to work now. I’ll need to run more tests though. I was able to make two separate packages with the custom field filled out, confirm each package and confirm shipment.

 

packMode
// Replaces the previous implementation with a new one.
.Intercept.CreateTransitions.ByReplace(basis =>
{
    // Creates a list of sequential transitions.
    return basis.StateFlow(flow => flow
        .From<PackMode.ShipmentState>()
        .NextTo<PackMode.BoxState>()
        .NextTo<BoxPackageTransferLabel>() //inserted new state for scanning transfer label
        .NextTo<WMSBase.InventoryItemState>()
        .NextTo<WMSBase.LotSerialState>()
        .NextTo<PackMode.ConfirmState>()
        .NextTo<CommandOrShipmentOnlyState>()
        .NextTo<PackMode.BoxConfirming.StartState>()
        .NextTo<PackMode.BoxConfirming.WeightState>()
        .NextTo<PackMode.BoxConfirming.DimensionsState>()
        .NextTo<PackMode.BoxConfirming.CompleteState>()

        );
});

 

 

Not sure why you’re decompiling that code.  It’s in the CodeRepository.

\App_Data\CodeRepository\PX.Objects\SO\WMS\Modes\PackMode.cs

 


 


Forum|alt.badge.img
  • Author
  • Freshman II
  • September 15, 2026

You’re right, I just used the go to definition in visual studio on PickPackShip to see this same part as well in decompiled code