How to override properly CreatePaymentProc method of SOOrderEntry graph in Acumatica

Hello everybody,

today I want to leave short note on how to override and call CreatePaymentProc method of Acumatica which I discovered today with Naveen from Kensium.

My favorite way of overriding methods in Acuamtica with usage of Action and passing there parameters doesn't work. That is because Acumatica uses in method CreatePaymentProc out modifier. Due to this, delegate declaration is needed. 

After some efforts and refactorings we found following code that is working:

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
    public delegate void CreatePaymentBase(SOOrder order, out PXGraph target, string paymentType);
    public virtual void CreatePaymentProc(SOOrder order, out PXGraph target, string paymentType,
        CreatePaymentBase baseAction)
        baseAction(order, out target, paymentType);
        var resultGraph = target as ARPaymentEntry;
        resultGraph.Document.Current.ExtRefNbr = "12xx14";

With such code you can call base method, and modify what it produces.

Comments (2) -

  • How about the VoidCheckProc because I'm trying to void the payment but I get a error message says
    "Error: Reference Nbr. '002217' cannot be found in the system." even I use the voidCheck.Press() still this error occurred.
  • Hi Leomil, I suggest for you to check particular sales order manually, and also why it has something to do with 002217. Also want to say that VoidCheckProc is avaialbe in plenty of graphs, so not sure which you mean. For example I have found VoidCheckProc in APPaymentEntry, APQuickCheckEntry, ARCasheSalesEntry, ARPaymentEntry etc. Please tell a bit more which of them you tried to extend with VoidCheckProc method?

Add comment