Skip to main content
Solved

Pick Pack Ship screen list sort order


Forum|alt.badge.img+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

Best answer by markusray17

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.

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+5
  • Jr Varsity II
  • 237 replies
  • Answer
  • August 8, 2022

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.


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 93 replies
  • October 2, 2023

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

 


Forum|alt.badge.img
  • Acumatica Employee
  • 45 replies
  • December 31, 2024

Please note that sorting doesn't work in pick pack ship by design, because this screen has it's own sorting logic (lines, that are picked completely are automatically moved to the bottom of the list). That's why manual sorting doesn't work.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings