Solved

The GetProcessDelegate does not work in version 2022 R2

  • 27 January 2023
  • 7 replies
  • 134 views

Userlevel 1

Hi guys, I have a small problem, the GetProcessDelegate method works in the old version, but in this new version it doesn't give an error.

here is the code.

protected void PrintChecksFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
        {

            var row = (PrintChecksFilter)e.Row;

            if (row == null)
                return;

            if (del != null)
                del(sender, e);
            var processDelegate = (PXProcessingBase<APPayment>.ProcessListDelegate)Base.APPaymentList.GetProcessDelegate();
        }

icon

Best answer by Shawn Burt 27 January 2023, 18:10

View original

7 replies

Userlevel 5
Badge +1

What graph are you extending?

I just tried this and its working fine. I assume APPrintChecks based on the row override.

Userlevel 5
Badge +1

sorry was being special and misread the version I was testing in. I was in 21R2 and looking at 22R2 now, it seems that the code for GetProcessDelegate is no longer present. I am looking to see if there is an alternative. Sorry for the confusion.

Userlevel 5
Badge +1

in the developer release notes it is listed as a deprecated:
https://acumatica-builds.s3.amazonaws.com/builds/22.2/ReleaseNotes/AcumaticaERP_2022R2_ReleaseNotes_for_Developers.pdf

Userlevel 1

What graph are you extending?

I just tried this and its working fine. I assume APPrintChecks based on the row override.

 

I am extending: APPrintChecks_Extension

protected void PrintChecksFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            var row = (PrintChecksFilter)e.Row;
            if (row == null) return;
            if (del != null) del(sender, e);
            var processDelegate = (PXProcessingBase<APAdjust>.ProcessListDelegate)Base.APDocumentList.GetProcessDelegate();
            Base.APDocumentList.SetProcessDelegate(delegate (List<APAdjust> apDocs)
            {
                MethodsTest(apDocs, processDelegate);//here my code
            });
        }

Userlevel 5
Badge +1

can I see code for MethodTest,

trying to see if there is an alternative way to infer the process delegate as Acumatica has deprecated the official way to get it.

Userlevel 5
Badge +1

try this for getting the process delegate.

its not technically supported by acumatica but I think its your only option here

 

            var processDelegate = (PXProcessingBase<APAdjust>.ProcessListDelegate)Base.APDocumentList.GetType().GetProperty("ProcessDelegate", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(Base.APDocumentList);

 

Userlevel 1

can I see code for MethodTest,

trying to see if there is an alternative way to infer the process delegate as Acumatica has deprecated the official way to get it.

here is my code:

 

 public virtual void MethodsTest(List<APPayment> apDocs, PXProcessingBase<APPayment>.ProcessListDelegate processDelegate)
        {
            PXGraph.InstanceCreated.AddHandler<APPaymentEntry>((apgraph) =>
           apgraph.RowUpdated.AddHandler<APPayment>((c, e) =>
           {
               var app = (APPayment)e.Row;
               var api = app.GetExtension<xtAPPayment>();

               PrintChecksFilter pch = Base.Filter.Current;
               var pchExt = pch.GetExtension<PrintChecksFilterExt>();
               if (app != null && pchExt != null)
               {
                   api.TMedioPago = pchExt.UsrTMedioPago;
               }
           }));
            if (processDelegate != null)
                processDelegate(apDocs);
        }

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