From 198dbd8d59e52c9459520d298628f998ab628bf7 Mon Sep 17 00:00:00 2001 From: wenjiefan Date: Mon, 17 Aug 2026 11:27:41 +0200 Subject: [PATCH] Add page action Enabled false-positive guard Document that an OnAction trigger need not duplicate a TestField check when the action's Enabled expression already prevents UI invocation with the field blank. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- ...nabled-action-need-not-repeat-testfield.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 microsoft/knowledge/error-handling/enabled-action-need-not-repeat-testfield.md diff --git a/microsoft/knowledge/error-handling/enabled-action-need-not-repeat-testfield.md b/microsoft/knowledge/error-handling/enabled-action-need-not-repeat-testfield.md new file mode 100644 index 0000000..4386d36 --- /dev/null +++ b/microsoft/knowledge/error-handling/enabled-action-need-not-repeat-testfield.md @@ -0,0 +1,22 @@ +--- +bc-version: [all] +domain: error-handling +keywords: [page-action, onaction, enabled-expression, testfield, mandatory-field, ui-validation, false-positive] +technologies: [al] +countries: [w1] +application-area: [all] +--- + +# An enabled expression can make a repeated TestField unnecessary in OnAction + +## Description + +A page action's `Enabled` expression controls whether the user can invoke its `OnAction` trigger. When that expression requires a record field to be nonblank, the UI cannot invoke the action while the field is blank. Repeating the same presence check with `TestField` at the start of `OnAction` is therefore not required for that UI path. + +## Best Practice + +Do not flag a missing `TestField` in `OnAction` when the action's `Enabled` expression already proves that the same field is nonblank before UI invocation. Require validation in shared business logic or other entry points that do not have the action's UI guard. + +## Anti Pattern + +Recommending an unconditional duplicate `TestField` solely because `OnAction` uses the field, without accounting for an `Enabled` expression that prevents invocation while the field is blank.