Skip to content

Validation rules: an authored rule message cannot name record values, so a refusal cannot say "total 8,000 is below received 10,000" #37909

Backlog

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAk8tegvAi1ECkgCFfc

Filing gate ③ (maintainer-directed) · Source: maintainer — Irene chose 「先合并,提示写字段名」 on the hotcrm project thread's decision card (2026-11-27T10:33Z), whose option filed this platform card. Measured while building hotcrm#2827 (PR hotcrm#2836). · Type: Feature · Grade: left to objectstack triage.

Today

A validations[] rule's message is returned as written (or its translation) with no parameters. On objectstack main f7f9345, packages/objectql/src/validation/rule-validator.ts authoredRuleMessage(rule, messages) (~L4106) returns rule.message or the catalog translation verbatim; nothing interpolates values from the record being judged. 18.6.0 behaves the same (checkPredicate → authoredRuleMessage).

So a business rule can refuse a write but cannot tell the person by how much. HotCRM#2827 refuses re-confirming a sales order whose Total Price is below what was already received or invoiced. The approved card asked for "Order SO-0012's total 8,000.00 is below what was received (10,000.00)". The shipped message can only name the fields: "This order's Total Price is below what was already received (Received)…". HotCRM's contract_same_account rule on the order records the same limit.

Ask

Let an authored rule message reference values of the judged record, for example {total_price} / {received_amount} placeholders (or a messageParams map of field → expression), resolved against the same merged record the rule judged and rendered with the field's display format (currency, number, lookup name), in the translated message too. A missing or masked field (no read permission) renders empty, never its raw value.

Who benefits: every app with money or quantity rules (credit limits, quotas, stock, refunds). The person sees the figure to fix without opening another tab.

Dedupe: searched validation message interpolation record values, validation rule message params placeholders (open and closed), 0 hits on this mechanism. Related but different, closed: #28052 (state_machine message cannot name the refused move), #14253 (custom validation messages had no bundle key).

Consumer: hotcrm#2827 adds the amounts to its two messages (reconfirm_total_below_received, reconfirm_total_below_invoiced in src/o2c/extensions/sales-order.extension.ts) once a pinned release carries this.

Blocked-by: #35143
Blocked-by: #33806

Activity

  1. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:data · domain:server · Feature · p2 · pm:queue · size M; rationale: maintainer-directed (filed on the HotCRM thread's decision card). A validation rule's message cannot name record values, so a refusal cannot tell the user which numbers clash. area:business is not a North Star area, so it becomes area:data, the home of validation rules. p2 as a maintainer-directed feature with a named consumer (HotCRM). Recorded 2026-11-27T11:16Z.

  2. added
    domain:server
    pm:queue
    priority:p2
    and removed on Nov 27, 2026
  3. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

    Ruled · 2026-11-28T13:08Z · the contract shape of value holes in an authored validation-rule message. Analysed independently at the fable tier before it was put to the maintainer.

  4. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

    Serial · 2026-11-28T13:25Z · PR 1 of this card (spec + lint) waits on two in-flight claims whose File surface: meets it: #35143 (seat 6, packages/lint/**) and #33806 (seat 2, packages/spec). Blocked-by: lines added to the body; Notify: serial rung in both seats' mailboxes (#37458, #37498). Dispatched by this seat when they land.

  5. added
    pm:blocked
    and removed
    pm:queue
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:serverpm:blockedpriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions