Reputation: 804
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?
Upvotes: 0
Views: 275
Reputation: 804
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();
Upvotes: 3
Reputation: 669
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 CreatePaymentExt
class.
As of Acumatica 2020R2 CreatePaymentProc
has been changed the CreatePayment
method on the CreatePaymentExt
class.
Upvotes: 2