Skip to main content

 

Hi Team,

We don’t want to scan the Original location. Directly scan the destination location, and then scan the item.  When we scan the Item, it should take the default location from the item as the Original location.

We are trying to override the ScanMode related methods, which doesn’t help.

Any inputs or references on this are much appreciated !!

 

 

Thanks & Regards,
Vidyakeerthi K

 

 

Could you post what you've tried?


Sure @darylbowman 

Please find below screenshot which we tried.

 


@vidyakeerthik I recommend you to use the community KB articles to override/extend the new WMS BarcodeDrivenStateMachine architecture (https://community.acumatica.com/customization-tools-and-framework-245/how-to-customize-an-existing-screen-with-the-new-automated-warehouse-operations-engine-in-acumatica-erp-2021-r1-and-later-8029)

And use the below approach:

  1. Create a new ScanExtension for INScanTransfer like public class INScanTransfer_Extension : PX.Objects.IN.WMS.INScanTransfer.ScanExtension { }
  2. Override the DecorateScanMode to have TransferMode intercepted, and override the CreateTransitions method and remove the transition to SourceLocationState – which handles the source Location scan. This way it eliminates the transition to scan the Source Location.
  3. Now, after removing the transition to SourceLocationState, we need to set the value for SiteID so that the Transfer happens without any errors. In order to do this, override the DecorateScanState – intercept the HandleAbsence of AmbiguousLocationState since both SourceLocationState and TargetLocationState are extended from that and set the Basis.SiteID, Basis.TransferToSiteID and Basis.LocationID which would handling the setting of the source Location.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using PX.Common;
using PX.Data;
using PX.Data.BQL;
using PX.Data.BQL.Fluent;
using PX.BarcodeProcessing;
using PX.Objects.IN;
using PX.Objects;
using PX.Objects.IN.WMS;
using WMSBase = PX.Objects.IN.WMS.INScanRegisterBase<PX.Objects.IN.WMS.INScanTransfer, PX.Objects.IN.WMS.INScanTransfer.Host, PX.Objects.IN.INDocType.transfer>;
namespace PX.Objects.IN.WMS
{
public class INScanTransfer_Extension : PX.Objects.IN.WMS.INScanTransfer.ScanExtension
{
PXOverride]
public virtual ScanState<INScanTransfer> DecorateScanState(ScanState<INScanTransfer> original, Func<ScanState<INScanTransfer>, ScanState<INScanTransfer>> base_DecorateScanState)
{
var state = base_DecorateScanState(original);

if (state is INScanTransfer.TransferMode.AmbiguousLocationState sourceLocState)
{
sourceLocState.Intercept.HandleAbsence.ByOverride((basis, barcode, base_HandleAbsence) =>
{
if (Basis.Document == null)
{
Basis.SiteID = 154;
Basis.TransferToSiteID = 154;
}
Basis.LocationID = 155;
Basis.TransferToLocationID = null;
return base_HandleAbsence(barcode);
});

}
return state;
}

PXOverride]
public virtual ScanMode<INScanTransfer> DecorateScanMode(ScanMode<INScanTransfer> original, Func<ScanMode<INScanTransfer>, ScanMode<INScanTransfer>> base_DecorateScanMode)
{
var mode = base_DecorateScanMode(original);
if (mode is INScanTransfer.TransferMode transferMode)
{
transferMode.Intercept.CreateTransitions.ByReplace(basis =>
{
if (Basis.PromptLocationForEveryLine)
{
return basis.StateFlow(flow => flow
.From<WMSBase.WarehouseState>()
//.NextTo<INScanTransfer.TransferMode.SourceLocationState>()
.NextTo<INScanTransfer.InventoryItemState>()
.NextTo<WMSBase.LotSerialState>()
.NextTo<INScanTransfer.TransferMode.TargetLocationState>()
.NextTo<WMSBase.ReasonCodeState>());
}
else
{
return basis.StateFlow(flow => flow
.From<WMSBase.WarehouseState>()
//.NextTo<INScanTransfer.TransferMode.SourceLocationState>()
.NextTo<INScanTransfer.TransferMode.TargetLocationState>()
.NextTo<WMSBase.ReasonCodeState>()
.NextTo<INScanTransfer.InventoryItemState>()
.NextTo<WMSBase.LotSerialState>());
}
});
}
return mode;
}
}
}

 


Reply