In SO Process Orders, I am trying to change the sort sequence for SO’s displayed. The default is by Order number, but I want it sorted by RequestDate instead, when the list is initially displayed. I created a SOCreateShipment extension, and extended the BuildCommandCreateShipment() method:
public class SOCreateShipment_Extension : PXGraphExtension<SOCreateShipment>
{
#region Event Handlers
public delegate PXSelectBase<SOOrder> BuildCommandCreateShipmentDelegate(SOOrderFilter filter);
rPXOverride]
public PXSelectBase<SOOrder> BuildCommandCreateShipment(SOOrderFilter filter, BuildCommandCreateShipmentDelegate baseMethod)
{
PXTrace.WriteInformation("BuildCommandCreateShipment() started from extension");
// Add Order By Request Date to default view
PXSelectBase<SOOrder> extFilter = baseMethod(filter);
extFilter.OrderByNew<OrderBy<Asc<SOOrder.requestDate>>>();
string errmsg = "extFilter value is: " + extFilter.ToString();
PXTrace.WriteInformation(errmsg);
return extFilter;
}
The trace Information does show that the ‘Order By’ is added to the DataView. I can also execute the Trace’s generated SQL in Microsoft SQL Studio, and I do see the order rows sorted by RequestDate.
However, the rows still display to the form in Order Number sequence.
What am I missing?
Using version 2021 R2 Build 21.203.0026