Solved

Overriding a DataView that has a delegate view method

  • 1 September 2022
  • 2 replies
  • 471 views

Userlevel 2
Badge

I created an extension to SOCreateShipment, to override the Data View for ‘Orders’. I made this change:

  public class SOCreateShipment_Extension : PXGraphExtension<SOCreateShipment>
  {
    #region Data Views
    [PXFilterable]
    public PXFilteredProcessing<SOOrder, SOOrderFilter,
              Where<True, Equal<True>>,
              OrderBy<Asc<SOOrder.requestDate>>> Orders;
    #endregion

    #region isActive
    public static bool IsActive()
    {
       return true;
    }
    #endregion
  }

I wanted only to override the OrderBy for the view, but I was forced to also add a ‘Where’ clause to the PXFilteredProcessing class. Now when I run the program, the OrderBy clause works properly, but the filter for the selected rows is now selecting all rows. The View has a delegate method ‘orders’ that has a more filtered where clause. But, when I debug SOCreateShipment, the ‘orders’ delegate method is never reached. If I remove this extension, the ‘orders’ delegate method IS reached. So the question is, when you override a base Data View, that also has a delegate method, do you ALSO have to override the delegate method?

icon

Best answer by Dioris Aguilar 1 September 2022, 20:52

View original

2 replies

Userlevel 5
Badge +2

@rdennisj57 Try overriding the view delegate as well but calling the baseMethod only.

Userlevel 2
Badge

Hi Dioris, thanks SO much for the advice. I tried this change and it worked! I’m getting the desired results now!

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