Solved

Customizing sort on Allocation Details Screen

  • 21 April 2022
  • 5 replies
  • 138 views

Hey all, 

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?

 

 

icon

Best answer by Tony Lanzer 25 April 2022, 22:00

View original

5 replies

Userlevel 4
Badge +2

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.

 

Userlevel 4
Badge +2

There are two possibilities that I can think of:

  1. 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.
  2. Use the PXProtectedAccess class attribute on an abstract graph extension. This is a way Acumatica provides to call protected members in an extended class. Here is a link to an example:  https://stackoverflow.com/questions/66568715/unable-to-use-protected-method-override-in-acumatica-graph-extension

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.

 

 

 

 

Userlevel 4
Badge +2

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?

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