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
  • 39 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.

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+1
  • Semi-Pro II
  • 41 replies
  • 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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings