Skip to content

Bug 641085: Document Check factbox does not update live on Purchase Invoice/Cr.Memo/Return Order#9086

Draft
alexei-dobriansky wants to merge 1 commit into
mainfrom
bugs/641085-EASY-PurchaseDocumentCheckFactbox
Draft

Bug 641085: Document Check factbox does not update live on Purchase Invoice/Cr.Memo/Return Order#9086
alexei-dobriansky wants to merge 1 commit into
mainfrom
bugs/641085-EASY-PurchaseDocumentCheckFactbox

Conversation

@alexei-dobriansky

@alexei-dobriansky alexei-dobriansky commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#641085

The subform OnModifyRecordEvent subscribers for Purchase Invoice, Purchase Credit Memo and Purchase Return Order all called GlobalPurchaseOrderPage.RunBackgroundCheck() instead of their own document's global page, so line edits never refreshed the open page's Document Check factbox (only F5 did). Point each subscriber at the matching global page, matching the already-correct Purchase Order and Sales subform handlers (three one-token fixes).

…nvoice/Cr.Memo/Return Order

The subform OnModifyRecordEvent subscribers for Purchase Invoice, Purchase Credit
Memo and Purchase Return Order all called GlobalPurchaseOrderPage.RunBackgroundCheck()
instead of their own document's global page, so line edits never refreshed the open
page's Document Check factbox (only F5 did). Point each subscriber at the matching
global page (GlobalPurchaseInvoicePage / GlobalPurchaseCreditMemoPage /
GlobalPurchaseReturnOrderPage), matching the already-correct Purchase Order and Sales
subform handlers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alexei-dobriansky alexei-dobriansky added the SCM GitHub request for SCM area label Jul 3, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 3, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor Author

Agentic PR Review - Round 1

Recommendation: Request Changes

What this PR does

This PR changes the purchase invoice, purchase credit memo, and purchase return order subform modify subscribers in Document Errors Mgt. to run the background check on the matching open purchase page instead of GlobalPurchaseOrderPage. This matches the Sales subform pattern and the existing purchase header/factbox routing, and it targets the stale Document Check FactBox problem described in Bug 641085.

The code change itself is the right shape: after a line modify, SetFullDocumentCheck(true) still runs and the call now reaches the factbox part on the page the user is editing. I did not see a side effect on the already-correct purchase order path, and no public signatures or events change. The remaining issue is validation: the exact live-refresh path that failed is not covered by a regression test.

Suggestions

S1 - Add live-refresh regression tests
Please add tests in Doc. Backgr. Error Handling for the changed purchase invoice, credit memo, and return order line-edit paths. Existing tests already cover the factbox on page open, but this bug is about the same open page refreshing after a line change. Without that test, the one-token routing errors can come back without being caught.

Risk assessment and necessity

Risk: Low runtime risk because this only changes page variables used in three UI event subscribers and keeps the same background validation call. The affected scenario is visible to users who enable Document Check on purchase invoices, credit memos, and return orders. No API, schema, event signature, or data persistence behavior changes.

Necessity: The ADO bug has a clear repro ([AI-REPRO] score 9/10) and real customer impact, because stale messages make Document Check unreliable and force an F5 refresh. The scope is right for the root cause, but a regression test is needed before merge because existing coverage did not catch this class of mistake.


[AI-PR-REVIEW] version=1 system=github pr=9086 round=1 by=alexei-dobriansky at=2026-07-06T09:00:35Z lastSha=99f99879e7434c010b6c1c6856876e88d8dd4ad2 suggestions=S1

@alexei-dobriansky

Copy link
Copy Markdown
Contributor Author

Re S1 (add live-refresh regression tests): acknowledged. The product change is a 3-token mirror of the already-correct Purchase Order / Sales subform handlers, and the existing DocBackgrErrorHandling tests cover the factbox. A true live-refresh test requires driving the background-validation task through the open TestPage after a subpart line edit, which isn't reliably reproducible headlessly. Given the low risk and the correctness of the fix, deferring the extra test rather than adding a flaky one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant