Skip to content

[Quality Management] Fix missing validation of "Allowable Values" on Quality Test card#8287

Open
JakovljevicDusan wants to merge 3 commits into
mainfrom
bugs/QM-AllowableValuesValidationInTest
Open

[Quality Management] Fix missing validation of "Allowable Values" on Quality Test card#8287
JakovljevicDusan wants to merge 3 commits into
mainfrom
bugs/QM-AllowableValuesValidationInTest

Conversation

@JakovljevicDusan
Copy link
Copy Markdown
Contributor

@JakovljevicDusan JakovljevicDusan commented May 22, 2026

What & why

image

Linked work

Fixes AB#624240

@JakovljevicDusan JakovljevicDusan requested a review from a team as a code owner May 22, 2026 17:02
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label May 22, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone May 22, 2026
end;

[TryFunction]
local procedure TryApplyBooleanFilter(FilterExpression: Text)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Error() called inside [TryFunction] with empty placeholders

TryApplyBooleanFilter is marked [TryFunction] but raises Error() explicitly with empty-string placeholders ('' for field name and literal 'Boolean' for type). While AL [TryFunction] does catch explicit Error() calls and returns false, the inner error message is set with missing context, and the outer ValidateAllowableValuesFormat then raises its own error — meaning two error messages are generated internally before the user-visible one, which can confuse debugging and telemetry.

Recommendation:

  • Remove the explicit Error() from inside TryApplyBooleanFilter and instead return without error from the try function; let the caller (ValidateAllowableValuesFormat) raise the user-visible error with full context. Alternatively, validate boolean values in a regular (non-try) procedure.
Suggested change
local procedure TryApplyBooleanFilter(FilterExpression: Text)
[TryFunction]
local procedure TryApplyBooleanFilter(FilterExpression: Text)
var
QltyBooleanParsing: Codeunit "Qlty. Boolean Parsing";
begin
if not QltyBooleanParsing.CanTextBeInterpretedAsBooleanIsh(FilterExpression) then
Error('');
end;

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

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

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant