[main] bug 646167 - Enhance VIES Declaration pages: update option captions for declaration types - #10047
Conversation
|
The page overrides the table-backed option field "Declaration Type" with 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 |
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
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility