Skip to main content
Solved

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

  • February 3, 2025
  • 1 reply
  • 107 views
  • Translate All

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.

View original

1 reply

DrewNisley
Pro I
Forum|alt.badge.img+4

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.

Translate