Skip to main content
Solved

Overriding a DataView that has a delegate view method

  • September 1, 2022
  • 2 replies
  • 823 views

Forum|alt.badge.img

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?

Best answer by Dioris Aguilar

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

2 replies

Dioris Aguilar
Jr Varsity I
Forum|alt.badge.img+2
  • Jr Varsity I
  • Answer
  • September 1, 2022

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


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • September 2, 2022

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