Skip to content

uc-apx create validation

Splice a validation construct into a page. The --type flag picks the validation shape; supported kebab values are: function-body-boolean, no-rows-returned, not-null, numeric, plsql-expression, regexp, rows-returned, sql-expression, valid-date, valid-timestamp. Each shape has its own required inputs (—code, —item, —regexp).

uc-apx create validation [flags]
FlagTypeDefaultDescription
--associated-itemstringPage item that the error message attaches to (emits error.associatedItem: @<id>)
--codestringPL/SQL or SQL body (literal text or @path/to/file)
--display-locationstringerror.displayLocation (e.g. inlineInNotification)
--dry-runPrint rendered validation to stdout without writing
--error-messagestringError message shown when the validation fails [required]
--forceOverwrite an existing validation with the same id
--idstringOverride the construct id (default: kebab-case of —name)
--itemstringPage item name (required for item-based types)
--namestringDisplay name of the validation [required]
--pagestringTarget page (numeric ID, alias, or name) [required]
--regexpstringRegular expression (required when —type regexp)
--sequenceintexecution.sequence (default: max existing validation sequence + 10)
--server-side-conditionstringFree-form serverSideCondition body (e.g. “type=expression value=…”); mutually exclusive with —when-button-pressed
--typestringValidation kind: function-body-boolean, no-rows-returned, not-null, numeric, plsql-expression, regexp, rows-returned, sql-expression, valid-date, valid-timestamp [required]
--when-button-pressedstringOnly run when this button was pressed (shortcut for serverSideCondition.whenButtonPressed)
FlagTypeDefaultDescription
--app-dirstring.Path to the APEX application directory
--json-prettyOutput in pretty-printed JSON (human-readable) instead of minified JSON
--toonOutput in TOON format (human-readable, token-efficient) instead of JSON
Terminal window
uc-apx create validation \
--page 36 \
--name "End after Beginning" \
--type function-body-boolean \
--code @validations/end-after-beginning.plsql \
--error-message "Display From must come before Display Until."

Using --dry-run to preview the generated construct (no files are written):

Terminal window
uc-apx --app-dir examples/brookstrut create validation --page 46 --name Store Required --type not-null --item P46_STORE_NAME --error-message Please select a store. --dry-run
Generated APEXlang
validation store-required (
name: Store Required
execution {
sequence: 10
}
validation {
type: itemIsNotNull
item: P46_STORE_NAME
}
error {
errorMessage: Please select a store.
}
)