0

What method should I use to customize the "process" button on the AP 505200 screen. I need to record records in a certain table when I press the Process button

Many thanks in advance!

Marco A.
  • 27
  • 5

1 Answers1

1

The method is mapped to the Process/Process All actions using the SetProcessDelegate method of the processing data view.

First locate the Graph of the AP505200 screen (APReleaseChecks): enter image description here

In the Source Code screen search for APReleaseChecks graph and find the SetProcessDelegate method: enter image description here

APPaymentList.SetProcessDelegate(list => ReleasePayments(list, action));

The process delegate ReleasePayments method is static so you can't easily override it. Try using SetProcessDelegate to call your own process delegate that will in turn call the base one.

public class APReleaseChecks_Extension : PXGraphExtension<APReleaseChecks>
{
    public virtual void ReleaseChecksFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
    {
        ReleaseChecksFilter filter = e.Row as ReleaseChecksFilter;

        if (filter != null)
        {
            Base.APPaymentList.SetProcessDelegate(delegate (List<APPayment> list)
            {
                // Do processing on list items before base process delegate
                // [...]

                // Call base process delegate
                APReleaseChecks.ReleasePayments(list, filter.Action);

                // Do processing on list items after base process delegate
                // [...]
            });
        }
    }
}
Hugues Beauséjour
  • 8,067
  • 1
  • 9
  • 22