Skip to content

[main] bug 646167 - Enhance VIES Declaration pages: update option captions for declaration types - #10047

Open
David Holuša (DavidHolusa) wants to merge 2 commits into
mainfrom
bugs/646167-main-VIESCorrecticeSupplementaryForSK
Open

[main] bug 646167 - Enhance VIES Declaration pages: update option captions for declaration types#10047
David Holuša (DavidHolusa) wants to merge 2 commits into
mainfrom
bugs/646167-main-VIESCorrecticeSupplementaryForSK

Conversation

@DavidHolusa

@DavidHolusa David Holuša (DavidHolusa) commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What & why

Extract the "Corrective-Supplementary" declaration type validation from the "Declaration Type" field's OnValidate trigger into a dedicated CheckDeclarationType() procedure, protected by the OnBeforeCheckDeclarationType integration event with the IsHandled pattern.

In CZ legislation, submitting a "Corrective-Supplementary" VIES Declaration is no longer allowed, so the option is blocked with an error. However, SK legislation still requires both Corrective and Corrective-Supplementary declaration types. Since the "Declaration Type" field uses an Option data type (not an Enum), SK partners cannot extend it via a table extension. By extracting the validation into a procedure with an integration event, SK localization can subscribe to OnBeforeCheckDeclarationType and set IsHandled := true to allow the "Corrective-Supplementary" option in their localization.

The same CheckDeclarationType() procedure is also called from the Export() procedure to ensure consistent validation.

Linked work

Fixes AB#646167

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

  • Verified that selecting "Corrective-Supplementary" as Declaration Type on the VIES Declaration Header card raises the error 'The Corrective-Supplementary type is no longer supported.' (CZ behavior unchanged).
  • Verified that the Export() action on a released VIES Declaration with "Corrective-Supplementary" type also raises the same error.
  • Confirmed that subscribing to OnBeforeCheckDeclarationType and setting IsHandled := true suppresses the error, allowing SK localization to use the "Corrective-Supplementary" option.
  • No new tests added — this is a refactor that extracts existing logic behind an integration event; existing test coverage for the validation behavior remains valid.

Risk & compatibility

  • Non-breaking change: The default behavior is identical — the error is still raised for CZ localization. The only difference is that the validation is now extensible via the OnBeforeCheckDeclarationType integration event.
  • SK (and other) localization partners can now subscribe to the event to allow the "Corrective-Supplementary" declaration type in their legislation without modifying the base app.
  • No data migration, upgrade, or permission changes required.

@DavidHolusa
David Holuša (DavidHolusa) requested a review from a team August 7, 2026 12:16
@github-actions github-actions Bot added the Finance GitHub request for Finance area label Aug 7, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Style}$

The page overrides the table-backed option field "Declaration Type" with OptionCaption = 'Normal,Corrective';, but the underlying field (table 31075 "VIES Declaration Header CZL", field 20) declares three OptionMembers (Normal, Corrective, Corrective-Supplementary) and a matching 3-entry table-level OptionCaption. Overriding with only 2 captions breaks the required positional count/alignment between OptionCaption and OptionMembers: any record still holding the third value ("Corrective-Supplementary") will render with a blank or misaligned caption in this dropdown, and since the field is editable here, the dropdown itself is incomplete. Either remove the page-level OptionCaption override (inherit the table's captions) or supply all three captions.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

                field("Declaration Type"; Rec."Declaration Type")
                {
                    ApplicationArea = Basic, Suite;
                    Importance = Promoted;
                    ToolTip = 'Specifies type of VIES Declaration (Normal, Corrective).';

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4

Comment thread src/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VIESDeclarationsCZL.Page.al Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant