Download page Associating Constraint Rules to a Cart.
Associating Constraint Rules to a Cart
This associates constraints rules to a cart.
API
Signature
associateConstraintRules
webService static void associateConstraintRules(Id cartId, List existingPrimaryNumbers)
Parameters
Name
Type
Description
cartId
ID
The id of the cart.
existingPrimaryNumbers
List<Integer>
This is a collection of primary numbers for which rules are already attached. When existing primary numbers are supplied, rules are associated with the new lines; whereas when null or empty collection is supplied, rules are attached to all the line items.
Code Sample
The sample below enables you to associate a constraint rule to a product added as a line item in a cart. The sample below fetches the line numbers of the products in the cart and associates the constraint rule to the new line numbers of the cart. If the list object for primary line items is null, then the constraint rules are associated with all the products in the line items of the cart. For example if the delivery and packaging charge constraint rule is already applied to the existing products in the cart, you will provide a list of collection of primary line items comprising selected products to which the rules are already applied, thus enabling the delivery and packaging constraint rule to be associated with the new line items added to the cart.
Use the following information in your integrations with CPQ Web Services API. Refer to Integrating Conga with External Systems for information on how to get started.