0

I'm upgrading a customization that was able to create payments on Sales Orders via code. Prior to 2020R2 I could use something along the lines of...

PXGraph graph;
orderEntry.CreatePaymentProc(orderEntry.Document.Current, out graph);
ARPaymentEntry paymentEntry = (ARPaymentEntry)graph;
ARPayment payment = paymentEntry.Document.Select();

payment.PaymentMethodID = ...;
payment.CuryOrigDocAmt = ...;
payment.ExtRefNbr = ...;
payment.CashAccountID = ...;

paymentEntry.Document.Update(payment);
paymentEntry.Actions.PressSave();

As of Acumatica 2020R2 CreatePaymentProc is no longer a method of SOOrderEntry.

How can the same result be achieved?

Nickolas Hook
  • 774
  • 5
  • 13

2 Answers2

3

The full solution here involved a couple additional method calls...

SOOrder order = orderEntry.Document.Current;
CreatePaymentExt createPaymentExt = orderEntry.GetExtension<CreatePaymentExt>();
SOQuickPayment payment = createPaymentExt.QuickPayment.Current;
createPaymentExt.SetDefaultValues(payment, order);

payment.PaymentMethodID = ...;
payment.CuryOrigDocAmt = ...;
payment.ExtRefNbr = ...;
payment.CashAccountID = ...;

ARPaymentEntry paymentEntry = createPaymentExt.CreatePayment(payment, order, ARPaymentType.Payment);
paymentEntry.Save.Press();
Nickolas Hook
  • 774
  • 5
  • 13
2

All of the methods and actions for the payment creating for the Sales Orders records in the Acumatica 2020R2 release you can find in the extension CreatePaymentExtclass.

As of Acumatica 2020R2 CreatePaymentProc has been changed the CreatePayment method on the CreatePaymentExt class.

Vardan Vardanyan
  • 649
  • 5
  • 12