You are here:
Cardinality of Child Products in a Bundle
For each child item in a bundle, there is a minimum and a maximum quantity, as well as the default quantity. When creating a bundle, a product administrator sets up these cardinality values.
For instance, the Admin adds bundle A, which brings along Child1, Child2, and Child3 (say, Triple-Play as the parent and you get internet, catv, and phone). Let's say that the default is that you get one of each. But you might want 2 or 3 set-top boxes for your CATV. The Min and Max parameters would say that you must have at least the Min number and you cannot have more than the Max number. The code rolls back any quantity change outside of the Min and Max values.
This appears on an order, quote, or opportunity as the following:
The following code is an example to enforce the cardinality of PCIs.
DefaultHandleActionImplementation.updateProduct() when update is to Quantity
if LineNumber__c length() < 5 this is top level item skip constraint logic query to get Product2.Id and Name from PricebookEntry which allows query
for ProductChildItem Min / Max
if Min < >null - need to enforce contraint
if Qty >= Min && Qty <= Max update Qty
else create message which posts to exception
else - update Qty
else - update Qty

