Setting up a validation rule for purchase orders
This guide explains how to configure a validation rule that issues a warning when purchase orders contain specific products. The warning does not prevent order creation.
Add an assortment code
- Navigate to Config > Products > Purchase Orders > Non-purchasable assortment codes.
- Enter the assortment code for the product that should trigger validation.
- If no assortment codes exist, add them under Products > Properties tab > Assortment codes.
Configure the connector
- Go to Config > Advanced > Connector.
- Add the following configuration:
{
"name": "assortmentCodeValidator",
"isAuthenticatedManually": false,
"timeOut": "00:00:00",
"implementations": [
"IPurchaseOrderValidator"
],
"properties": [],
"disableStandardErrorPolicy": false,
"enabledForMarkets": [],
"disabledForMarkets": []
}Assign non-purchasable assortment codes to products
- Select the product.
- Add the assortment code to the product.
Add validation to workflow
- Add purchase order validation to relevant workflow steps.
Validate the Purchase Order
- If a purchase order includes a restricted product, a validation warning appears.
- The order can still be processed without removing the product.
Expected behavior
- A validation message displays when restricted products are included in a purchase order.
- The purchase order can be completed despite the warning.
This setup ensures that users receive warnings for specific products without blocking order creation.