Creating Limit Rules with Conditions (6.2)
Let’s create a Limit Rule to restrict the number of products in one delivery or order based on the condition:
-
Exception Condition: the Limit Rule must restrict the number of products in a whole order cart if the specified condition is met.
-
Apply Condition: the Limit Rule must restrict the number of products in a single delivery, except for such products.
Exception Condition
To create a Limit Rule:
-
Go to the Limit Rules tab and click New.
-
Select the Delivery record type and click Next.
-
Enter the following:
-
Sales Organization: Default Sales Org.
-
Min Quantity: 5.
-
Order Type: Order.
-
Delivery Criteria Path: specify the Delivery fields as criteria to apply a limit rule: orders__DeliveryDate__c,orders__AccountId__c.
-
Exception Condition: enter the following:
{ "exceptionCondition": { "operator":"AND", "productCount": { "filter": { "operator":"AND", "items": [ { "field":"orders__ProductId__c", "operator":"equal", "value":"a0V17000005T7QTEA0" } ] }, "minCount":1 }, "requiredProducts": { "productQuantityField":"order__Quantity__c", "productIdField":"orders__ProductId__c", "operator":"AND", "items": [ { "product":"a0V17000005T7QTEA0", "minQuantity":5 } ] } } }
-
-
Click Save.
The Limit Rule is created.
Apply Condition
To create a Limit Rule:
-
Go to the Limit Rules tab and click New.
-
Select the Order record type and click Next.
-
Enter the following:
-
Sales Organization: Default Sales Org.
-
Amount: enter the field with the total price: orders__TotalPrice__c.
-
Min Amount: 5.
-
Max Amount: 50.
-
Order Type: Order.
-
Apply Condition: enter the following:
In the value key, specify a product that must be added to the order cart to apply the limit rule. { "applyCondition": { "operator":"AND", "items": [ { "field":"orders__ProductId__r.Name", "operator":"equal", "value":"AL WHEY-BASED 930 NEON MOJITO/pt bl" } ] } }
-
-
Click Save.
The Limit Rule is created.