Solved

Pick Pack Ship screen list sort order

  • 8 August 2022
  • 2 replies
  • 207 views

Userlevel 4
Badge +1

Hello, I’d like to change the sort order of scanned items the Pick Pack Ship screen on 2022R1. I have asked a similar question previously in the 'mobile development' group and was able to update the sort order on 2021R1, however, the coding of the Pick Pack Ship screen on 2022R1 has changed substantially and the method I used previously no longer works.

I’d like to reorder the ‘picked’ view, let’s say by Description.

I believe the picked view is in the PXObjects\SO\WMS\Modes\PickMode.cs file in the code CodeRepository.

The picked view and delegate are shown below, and it’s a relatively simple definition.

public class Logic : ScanExtension
                    {
#region Views
public SelectFrom<SOShipLineSplit>.InnerJoin<SOShipLine>.On<SOShipLineSplit.FK.ShipmentLine>.
OrderBy<
SOShipLineSplit.shipmentNbr.Asc,
SOShipLineSplit.isUnassigned.Desc,
SOShipLineSplit.lineNbr.Asc>.
View Picked;

protected virtual IEnumerable picked()
{
 var delegateResult = new PXDelegateResult { IsResultSorted = true };
 delegateResult.AddRange(Basis.GetSplits(Basis.RefNbr, includeUnassigned: true, s => s.PickedQty >= s.Qty));
 return delegateResult;
 
 endregion
}


My updated view will change the sort order.

 public SelectFrom<SOShipLineSplit>.InnerJoin<SOShipLine>.On<SOShipLineSplit.FK.ShipmentLine>
.OrderBy<SOShipLine.tranDesc.Asc,
SOShipLineSplit.isUnassigned.Desc,
SOShipLineSplit.lineNbr.Asc
>.View Picked;

My problem is that I don’t know where to define the replacement view. I’m finding the PickPackShip+Host class difficult to navigate.
I thought I’d be able to define the view in PickPackShip.Host, as shown below, but this doesn’t work. 

public class PickPackShip_Host_Extension : PXGraphExtension<PX.Objects.SO.WMS.PickPackShip.Host>
{
public SelectFrom<SOShipLineSplit>.InnerJoin<SOShipLine>.On<SOShipLineSplit.FK.ShipmentLine>
.OrderBy<
SOShipLine.tranDesc.Asc,
SOShipLineSplit.isUnassigned.Desc,
SOShipLineSplit.lineNbr.Asc
>.View Picked;

protected virtual IEnumerable picked()
{
var delegateResult = new PXDelegateResult { IsResultSorted = true };
//delegateResult.AddRange(Basis.GetSplits(Basis.RefNbr, includeUnassigned: true, s => s.PickedQty >= s.Qty));

return delegateResult;
}

The sort order doesn’t change and the delegate isn’t hit in debug mode.
Can anyone advise which class should be extended in order to make this change?

Thanks
Steve

icon

Best answer by markusray17 8 August 2022, 23:04

View original

2 replies

Userlevel 6
Badge +5

PickPackShipHost is the base graph and PickPackShip is the graph extension so you would need something like:

public class PickPackShipExt : PXGraphExtension<PickPackShip, PickPackShipHost>{

public static bool IsActive() => true;

//Your Code Here
}

to ensure you are extending the extension.

Userlevel 4
Badge +1

Returning to this issue after a long break...
I have tried this suggestion using the following code

public class PickPackShipExt : PXGraphExtension<PickPackShip, PickPackShip.Host>
{
public static bool IsActive() => true;
public FbqlSelect<SelectFromBase<SOShipLineSplit, TypeArrayOf<IFbqlJoin>.Append<TypeArrayOf<IFbqlJoin>.Empty, FbqlJoins.Inner<SOShipLine>.On<SOShipLineSplit.FK.ShipmentLine>>>
.Order<By<BqlField<SOShipLineSplit.locationID, IBqlInt>.Asc>>, SOShipLineSplit>.View Picked;
}

The FbqlSelect statement is a copy of the code from the base, except I have replaced the .Order section to order only by location. 

The result is - odd. The rows in the grid are correctly sorted by Location, but there is no filtering! It looks like every shipment has been added to the list BEFORE I have entered a shipment number into the Scan textbox. See the screen shot below.

 

Can anyone advise why this is happening please, and how to update the code to keep the filtering but update the sorting?

I’ve also tried with the following code but this doesn’t seem to replace the ‘Picked’ view in PickPackShip.PickMode.Logic. The end result is an unsorted list of shipment lines.

public class LogicExt : PickPackShip.PickMode.Logic
{
public static bool IsActive() => true;
public FbqlSelect<SelectFromBase<SOShipLineSplit, TypeArrayOf<IFbqlJoin>.Append<TypeArrayOf<IFbqlJoin>.Empty, FbqlJoins.Inner<SOShipLine>.On<SOShipLineSplit.FK.ShipmentLine>>>
.Order<By<BqlField<SOShipLineSplit.locationID, IBqlInt>.Asc>>, SOShipLineSplit>.View Picked;
}

 Any help would be appreciated because I’m out of ideas.
Thanks

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved