Issue happens because code runs before the journal line is fully saved
COMMIT inside validation breaks the UI flow → causes “works on 2nd/3rd try”
You’re also reading from the wrong table (Purch. Inv. Line instead of Vendor Ledger Entry)
Fix:
Remove COMMIT
Call CurrPage.SaveRecord() before recalculating
Read amount from Vendor Ledger Entry
Then Rec.Validate(Amount) + CurrPage.Update(false)
That stabilizes the update on the first Applies-to Doc. No. selection.
Regards,
Oussama Sabbouh
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.