#147 ShowMandatory + OnQueryClosePage Check
Two new UI community knowledge articles with code examples demonstrate best practices for marking required fields and validating request page input to prevent common defects like fields appearing optional or losing user input on validation errors.
- 6files
- 6AL files
- 0objects
Pull request · merged into main on 2026-09-02 by pri-kise · 6 files (+342 -0), 6 AL · feature · tier official · reviewed (checked by Opus)
What changed
- ShowMandatory only draws the asterisk and TestField or NotBlank only enforce, so a required field needs both
- The problem is worst on DelayedInsert list pages, where the error appears only after the user leaves the row
- OnPreReport runs after the request page closes, so validate in OnQueryClosePage too to keep the user’s input
- Guard the OnQueryClosePage check on CloseAction so Cancel does not trap the user, and keep the OnPreReport check for runs with no request page
- Both articles include bad and good AL samples
AL objects touched
community/knowledge/ui/showmandatory-on-code-required-page-fields.bad.al: added, not in the BC? snapshot yetcommunity/knowledge/ui/showmandatory-on-code-required-page-fields.good.al: added, not in the BC? snapshot yetcommunity/knowledge/ui/showmandatory-on-code-required-page-fields.md: added, not in the BC? snapshot yetcommunity/knowledge/ui/validate-request-page-input-in-onqueryclosepage.bad.al: added, not in the BC? snapshot yetcommunity/knowledge/ui/validate-request-page-input-in-onqueryclosepage.good.al: added, not in the BC? snapshot yetcommunity/knowledge/ui/validate-request-page-input-in-onqueryclosepage.md: added, not in the BC? snapshot yet
Context
- Systems: development
Source: metadata of a merged pull request in microsoft/BCQuality (bcquality): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).