Motivation
dependsOn copies a fixed source field when a related record is picked (price from the chosen product). Two recurring business shapes cannot be expressed:
- Conditional source selection: a partner carries a price-level classifier (wholesale/retail); the line price should copy from the product's
wholesalePrice OR retailPrice depending on the partner's classifier. Today only one fixed source field is possible.
- Header-mediated defaults: a document line should default a value from the DOCUMENT's related record - e.g. a per-line discount defaulting from the header partner's standard discount.
dependsOn can only reference relations of the line entity itself.
Proposal (discussion-first)
dependsOn: { relation: Product, valueFrom: { by: <path-to-classifier>, cases: { 1: wholesalePrice, 2: retailPrice } } } - a resolved source picked by a classifier value; or a more general expression hook.
- Allow
relation: to navigate one hop through a to-one of the same document (relation: Document.Partner, valueFrom: discount).
Both are UI + generated-write-path concerns (the same places dependsOn lives today); no schema impact.
Why upstream
Price levels and partner terms are universal ERP furniture; without this, price lists stay display-only in any intent-built application.
Motivation
dependsOncopies a fixed source field when a related record is picked (pricefrom the chosen product). Two recurring business shapes cannot be expressed:wholesalePriceORretailPricedepending on the partner's classifier. Today only one fixed source field is possible.dependsOncan only reference relations of the line entity itself.Proposal (discussion-first)
dependsOn: { relation: Product, valueFrom: { by: <path-to-classifier>, cases: { 1: wholesalePrice, 2: retailPrice } } }- a resolved source picked by a classifier value; or a more general expression hook.relation:to navigate one hop through a to-one of the same document (relation: Document.Partner, valueFrom: discount).Both are UI + generated-write-path concerns (the same places dependsOn lives today); no schema impact.
Why upstream
Price levels and partner terms are universal ERP furniture; without this, price lists stay display-only in any intent-built application.