Skip to main content
Answer

How to Update Unit Price and Recalculate Related Fields in Invoices and Memos (AR301000) Screen

  • February 3, 2025
  • 1 reply
  • 72 views

Forum|alt.badge.img

I want to update the unit price field in the detail section of the Invoices and Memos (AR301000) screen. I've tried the below method that updates the unit price for each line correctly. However, the problem is that other fields based on the unit price are not being recalculated. What should I do to update these other fields as well?
 

PXResultset<ARTran> TransactionLines = PXSelect<ARTran,
    Where<ARTran.refNbr, Equal<Required<ARTran.refNbr>>,
    And<ARTran.tranType, Equal<Required<ARTran.tranType>>>>>
    .Select(this.Base, currentView.RefNbr, currentView.DocType)
 

            if (TransactionLines != null){
                    foreach (ARTran TransactionLine in TransactionLines)
                    {
                        TransactionLine.CuryUnitPrice = 100;
                    }

            }

this.base.persist();
 

Any detailed instructions, tips, or code snippets would be greatly appreciated. Thank you!

Best answer by DrewNisley

Are you overriding the InvoiceEntry graph? If you are, just calling Base.Transactions.Update(TransactionLine), otherwise call invoiceEntryGraph.Transactions.Update(TransactionLine). That should trigger the related fields to update.

1 reply

DrewNisley
Pro I
Forum|alt.badge.img+3
  • Pro I
  • Answer
  • February 3, 2025

Are you overriding the InvoiceEntry graph? If you are, just calling Base.Transactions.Update(TransactionLine), otherwise call invoiceEntryGraph.Transactions.Update(TransactionLine). That should trigger the related fields to update.