Configure Price Quote (CPQ) CPQ for SOAP API Developers API Reference Constraint Web Service 2 Current: Associating Constraint Rule to Products Added to the Cart PDF Download PDF Download page Associating Constraint Rule to Products Added to the Cart. Current page All pages Associating Constraint Rule to Products Added to the Cart You can use this API to execute constraint rules on a list of products.APISignatureassociateConstraintRulesForProductswebService static Boolean associateConstraintRulesForProducts(Id cartId, List productIds)ParametersNameTypeDescriptioncartIdIdThe Id of the cart you added products to.productIdsList<Id>The list of Ids of the products you added to the cart.Response ParameterFieldTypeDescriptionIsSuccessBooleanIndicates whether the association was successful.Code SampleThe sample below enables you to executes a constraint rule on a list of line items in the given cart. public Boolean associateConstraintRules(String proposalID) { Apttus_Config2__ProductConfiguration__c cart = [SELECT Apttus_Config2__PriceListId__c, Id FROM Apttus_Config2__ProductConfiguration__c WHERE Apttus_QPConfig__Proposald__c =: proposalID LIMIT 1]; //Fetch All products from Product Configuration List<Apttus_Config2__LineItem__c> liSOList = [SELECT Apttus_Config2__ProductID__c FROM Apttus_Config2__LineItem__c WHERE Apttus_Config2__ConfigurationId__c = :cart.Id]; List<Id> productIds = new List<Id> (); for (Apttus_Config2__LineItem__c liSO: liSOList) { productIds.add(liSO.Apttus_Config2__ProductID__c); } Boolean isSuccess = Apttus_Config2.ConstraintWebService2.associateConstraintRulesForProducts(cart.Id, productIds); return isSuccess; } CODE ×