Skip to main content
Field constraints let a project define validation limits on extraction fields — for example, capping the customer reference at 50 characters because the downstream TMS rejects longer values. Values that violate a constraint block Send to TMS until an operator fixes them, so invalid payloads are caught in Vectrix before downstream publishing. The feature is project-configured. Constraints do not change what the extraction pipeline produces; they validate whatever value a field currently holds, whether it was extracted, defaulted, or entered manually.

Where to configure it

Open Project configuration > Fields and edit a field. Fields whose data type supports constraints show a Validation Constraints section in the editor dialog: Project admins can manage the Fields configuration screen for their own project, including field presets, field import/export, section ordering, high-level shipment detail ordering, and per-field settings. Superadmin access is not required for project-scoped field configuration.
Data typeAvailable constraints
string, textMinimum length, maximum length, pattern (regular expression)
integer, floatMinimum value, maximum value
Leave any input empty for no limit. The form rejects inconsistent configuration: negative lengths, a minimum greater than the maximum, or a pattern that is not a valid regular expression.
Patterns are unanchored JavaScript regular expressions. Use ^ and $ when the whole value must match, e.g. ^[A-Z0-9-]+$.

Example: customer reference limited to 50 characters

Edit the customer_reference field (shipment scope), set Maximum length to 50, and save. No code change or re-extraction is needed — the limit applies immediately to every shipment in the project.

How enforcement works

Constraints are checked in the app against the live field configuration:
  • Send to TMS is blocked while any violation exists. This applies to the send button on the shipment detail page and to the send actions on the order overview. The send button’s hover checklist lists each violation — for example “Customer Reference must be at most 50 characters (currently 62)” — and clicking an entry scrolls to and highlights the offending field.
  • Saving stays possible. Extraction can produce violating values on its own, and operators must be able to save work in progress. Saving a shipment with violations shows a warning toast listing them.
  • Empty values never violate constraints. Whether a field may be empty is controlled by the separate Mandatory flag.
Constraints apply to fields in the order, shipment, stop, goods_line, and item scopes. Order-scope fields are validated against the shipment’s parent order, which matters for projects that publish full order payloads to the TMS.
If the constraint configuration cannot be loaded when an operator sends a shipment, the send proceeds with a “Could not verify configured field limits” warning instead of being blocked.

Import, export, and presets

Constraints are part of the field catalog:
  • Export JSON includes each field’s constraints object, and Import JSON applies it.
  • Saved field presets store and restore constraints.
  • Importing a file or loading a preset created before constraints existed keeps the constraints currently configured on matching fields; they are only cleared when the imported field carries an explicit "constraints": null.
Constraint values that cannot be satisfied — negative lengths, inverted ranges, patterns that do not compile, or constraint kinds that do not match the field’s data type — are dropped on import rather than stored, so a bad import cannot permanently block sending.