Property description

The rules block on the date component enforces a conditional max-future-date limit. The allowed date range is determined by the current value of a driver attribute on the same record. Each driver value maps to a limit expressed in years or days. If the driver attribute is empty or its value does not match any threshold, the fallback limit applies.

Example in the UI

Minimal JSON

{
    "rules": {
        "driverAttributeTypeKey": "",
        "thresholds": [],
        "fallback": {
            "limit": {
                "kind": "none"
            }
        }
    }
}

The following example limits a date attribute to 3 years in the future when a regulation flag is set to YES, or 6 years when set to NO. If the flag is empty, no limit applies.

{
    "rules": {
        "driverAttributeTypeKey": "regulation_flag",
        "thresholds": [
            {
                "driverValue": "YES",
                "limit": {
                    "kind": "years",
                    "value": 3
                },
                "errorTranslationKey": "effective_from.error.max_3y"
            },
            {
                "driverValue": "NO",
                "limit": {
                    "kind": "years",
                    "value": 6
                },
                "errorTranslationKey": "effective_from.error.max_6y"
            }
        ],
        "fallback": {
            "limit": {
                "kind": "none"
            }
        }
    }
}

Nested properties

PropertyDescriptionValuesMandatory
driverAttributeTypeKeyKey of the attribute on the same record whose value determines which threshold is active.stringYes
thresholdsOrdered list of value-to-limit mappings. At least one entry is required. See thresholds (date component).arrayYes
fallbackLimit applied when the driver attribute is empty or its value does not match any threshold. Shape: { limit, errorTranslationKey? }.jsonYes

Validation and behavior

  • The active limit recalculates in real time when the driver attribute changes within the same form session.
  • If changing the driver attribute causes an already-set date to exceed the new limit, saving is blocked until the user corrects the date or reverts the driver.
  • If the date field whose limit broke isn’t open in edit mode, the error also appears as a toast (MrObjectMetadataPanel.alerts.dateViolationOnOtherAttribute). The toast headline names that field, and its submessage carries the threshold’s errorTranslationKey.
  • Existing records with dates beyond a newly configured limit are not affected. The rule activates only when the user next edits either the date or the driver attribute on that record.