We are seeing an issue in 2021 R1 where if an order comes in with a future date, it messes up the sort order on the Allocation Details screen. Because the sort doesn’t take into account the date, it just sorts by order number and so you have 3 orders together in the list but the middle one has a date 3 months in the future so users are accidentally printing pick lists for orders that don’t need to be filled. The way that Acumatica returns the filterable ResultRecords dataset, it re-populates the list every time a filter is selected. Trouble is that the CalculateResultRecords that it uses to filter the Result Records is protected. I have tried overriding the ResultsRecords sort but it doesn’t get applied. Can anyone help me figure out what is the right way to override the sort on this?
Page 1 / 1
If you’re referring to the Inventory Allocation Details screen (IN402000), the ResultRecords view is defined as below.
public PXSelectOrderBy<InventoryAllocDetEnqResult, OrderBy<Asc<InventoryAllocDetEnqResult.module, Asc<InventoryAllocDetEnqResult.qADocType, Asc<InventoryAllocDetEnqResult.refNbr>>>>> ResultRecords;
I would override this in a customization and change the order in the graph extension class member, or in its Initialize() method to suit your needs.
I added the following code to my extension:
[PXFilterable] public PXSelectOrderBy<InventoryAllocDetEnqResult, OrderBy<Asc<InventoryAllocDetEnqResult.module, Asc<InventoryAllocDetEnqResult.qADocType, Asc<InventoryAllocDetEnqResult.planDate, Asc<InventoryAllocDetEnqResult.refNbr>>>>>> ResultRecords;
It works unless you select a filter. Then sort gets re-done and the date is left out again.
It looks like the Filter view has a delegate method (filter()) that will also need addressed and sorted differently. You should be able to override this method, call it as its base method, then sort the results as you need them. Let me know if you want some sample code.
I see the filter delegate where there is another PXSelect but it’s protected can you still override this?
There are two possibilities that I can think of:
Inherit InventoryAllocDetEnq instead of extending it. You can then override the protected virtual method naturally in the child class. You would need to specify the new class in the UI instead of the original class.