Validation rule use case: You have a product A and you want to set up a validation rule such that when a user selects Product A and should not be able to enter more than 5 quantity.

To set up a validation rule

  1. On the Constraint Rule Condition Detail page, in the Criteria section, from Product Scope, select Product.
  2. In Product, enter Product A as the product and in the Match Conditions section, select Match in Primary Lines and click Save.
  3. On the Constraint Rule Action Detail page, in Message, type {0} cannot exceed 5 quantity. {0} denotes the condition product.
  4. From Action Type, select Validation and from Action Intent, select Show Message.
  5. From Action Disposition, select Warning.
  6. From Product Scope, select Action Criteria.
  7. In the Match Conditions section, select Match in Primary Lines and click Save.
  8. On the Constraint Rule Detail page, scroll down to the Constraint Rule Actions related list and click Edit Criteria.
  9. From Field, select Line Item : Quantity, from Operator, select greater than, and in Value, type 5. Click OK.

The validation type rule is saved and added. On the catalog page, when a user selects Product A, and enters quantity as 6. The system shows an error message that Product A cannot exceed 5 quantity.