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

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

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