Restrictions and Expression Restrictions
Restrictions validate property values entered in the configurator against defined rules. They prevent invalid configurations by displaying error messages or warnings when entered values fall outside permitted ranges or violate business rules.
The BOM Calculation Template provides two types of restrictions:
- Restrictions — Filter-based validation of dimension and quantity values
- Expression Restrictions — Formula-based validation using the expression engine
Restrictions
Restrictions use Business Central filter syntax to define allowed ranges for standard dimension fields. They are accessible via the Restrictions action on the BOM Calculation Template card.
Restriction Fields
| Field | Description |
|---|---|
| Validation Type | Determines the behavior when a value falls outside the filter. Error blocks the configuration. Warning displays a warning but allows the user to proceed. |
| Length Filter | A filter expression that defines allowed length values (e.g. 100..500). |
| Width Filter | A filter expression that defines allowed width values. |
| Height Filter | A filter expression that defines allowed height values. |
| Weight Filter | A filter expression that defines allowed weight values. |
| Unit Filter | A filter expression that defines allowed unit quantity values. |
Tip
Use standard Business Central filter syntax in these fields. For example, 100..500 allows values between 100 and 500, and <>0 requires a non-zero value.
Expression Restrictions
Expression Restrictions offer more flexible validation using the same expression engine as BOM template formulas. They are accessible via the Expression Restrictions action on the BOM Calculation Template card.
Expression Restriction Fields
| Field | Description |
|---|---|
| Validation Type | Error blocks the configuration. Warning displays a warning but allows the user to continue. |
| Calculation Expr | The expression that is evaluated. If the expression evaluates to a non-zero (true) value, the restriction is triggered and the message is displayed. Supports PROP["..."], variables, and all standard functions. |
| Message to Display | The message shown to the user when the restriction is triggered. |
Example
To prevent configurations where the length exceeds 2000 mm:
- Calculation Expr:
IIF(PROP["Length"] > 2000, 1, 0) - Message to Display:
Length must not exceed 2000 mm. - Validation Type: Error
Routing Expression Restrictions
In addition to BOM-level restrictions, there are also Routing Expression Restrictions available via the BOM Calculation Template card. These work the same way as expression restrictions but apply specifically to the routing template context.
How to Set Up Restrictions
- Open a BOM Calculation Template card.
- Choose the Restrictions action for filter-based validation, or choose Expression Restrictions for formula-based validation.
- Add a new line and set the Validation Type to Error or Warning.
- For restrictions: Enter filter values in the dimension fields.
- For expression restrictions: Enter a formula in Calculation Expr and a message in Message to Display.
Note
Restrictions are also versioned along with the BOM Calculation Template. When creating a new template version, all restrictions are copied to the new version.