From 41411e02b2f08184224c67b012d2a9d89b2f62cf Mon Sep 17 00:00:00 2001 From: Aleksandr Gladkov <59250993+AleksanderGladkov@users.noreply.github.com> Date: Tue, 24 Mar 2026 19:23:55 +0100 Subject: [PATCH] Bug 624892: Payment Practice Lines are not shown as before if you click on Generate on the Payment Practice page. (#7349) **ISSUE:** The Payment Practice Lines subpage is not shown after the lines were generated. The card page should be reopened. **CAUSE:** The Lines subpage part on Payment Practice Card used dynamic Visible = Rec."Lines Exist" which did not re-evaluate after Generate. **SOLUTION:** Always show the subpage, so lines appear immediately. Fixes [AB#626602](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/626602) --------- Co-authored-by: Aleksandr Gladkov --- .../App/src/Pages/PaymentPracticeCard.Page.al | 2 +- .../Test/src/PaymentPracticesUT.Codeunit.al | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Apps/W1/PaymentPractices/App/src/Pages/PaymentPracticeCard.Page.al b/src/Apps/W1/PaymentPractices/App/src/Pages/PaymentPracticeCard.Page.al index 3ec3418a76..c899463801 100644 --- a/src/Apps/W1/PaymentPractices/App/src/Pages/PaymentPracticeCard.Page.al +++ b/src/Apps/W1/PaymentPractices/App/src/Pages/PaymentPracticeCard.Page.al @@ -99,7 +99,7 @@ page 687 "Payment Practice Card" ApplicationArea = All; SubPageLink = "Header No." = field("No."); UpdatePropagation = Both; - Visible = Rec."Lines Exist"; + Visible = true; } } } diff --git a/src/Apps/W1/PaymentPractices/Test/src/PaymentPracticesUT.Codeunit.al b/src/Apps/W1/PaymentPractices/Test/src/PaymentPracticesUT.Codeunit.al index 944f710bd1..bd9c6ef507 100644 --- a/src/Apps/W1/PaymentPractices/Test/src/PaymentPracticesUT.Codeunit.al +++ b/src/Apps/W1/PaymentPractices/Test/src/PaymentPracticesUT.Codeunit.al @@ -571,6 +571,40 @@ codeunit 134197 "Payment Practices UT" PaymentPracticeLine.TestField("Modified Manually"); end; + [Test] + procedure PaymentPracticeCardLinesPartAlwaysVisible() + var + PaymentPracticeHeader: Record "Payment Practice Header"; + PaymentPracticeCard: TestPage "Payment Practice Card"; + VendorNo: Code[20]; + begin + // [FEATURE] [AI test 0.3] + // [SCENARIO 626602] Lines part on Payment Practice Card is visible after clicking Generate + Initialize(); + + // [GIVEN] Vendor "V" with company size and an entry in the period + VendorNo := PaymentPracticesLibrary.CreateVendorNoWithSizeAndExcl(CompanySizeCodes[1], false); + MockVendorInvoice(VendorNo, WorkDate(), WorkDate()); + + // [GIVEN] A payment practice header "PPH" + PaymentPracticesLibrary.CreatePaymentPracticeHeaderSimple(PaymentPracticeHeader); + + // [WHEN] Open the Payment Practice Card for "PPH" + PaymentPracticeCard.OpenEdit(); + PaymentPracticeCard.Filter.SetFilter("No.", Format(PaymentPracticeHeader."No.")); + + // [THEN] Lines part is visible even before generating + Assert.IsTrue(PaymentPracticeCard.Lines.Visible(), 'Lines part should be visible before generating.'); + + // [WHEN] Generate the payment practice lines + PaymentPracticeCard.Generate.Invoke(); + + // [THEN] Lines part is still visible after generating + Assert.IsTrue(PaymentPracticeCard.Lines.Visible(), 'Lines part should be visible after generating.'); + + PaymentPracticeCard.Close(); + end; + local procedure Initialize() begin LibraryTestInitialize.OnTestInitialize(Codeunit::"Payment Practices UT");