[Quality Management] Fix missing validation of "Allowable Values" on Quality Test card#8287
[Quality Management] Fix missing validation of "Allowable Values" on Quality Test card#8287JakovljevicDusan wants to merge 3 commits into
Conversation
| end; | ||
|
|
||
| [TryFunction] | ||
| local procedure TryApplyBooleanFilter(FilterExpression: Text) |
There was a problem hiding this comment.
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 insideTryApplyBooleanFilterand 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.
| 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
|
What & why
Linked work
Fixes AB#624240