SAP Knowledge Base Article - Public

3507540 - Collection was modified error thrown during Add To Quote

Symptom

When attempting to add a Configurable product to a Quote, CPQ throws the following error: "Error during Add to quote - Collection was modified; enumeration operation may not execute.". 

Environment

SAP SALES CLOUD CPQ

Reproducing the Issue

  1. Open a Quote
  2. Configure a Configurable Product that has a script that modifies product structure in the On Item Added Event
  3. When adding product to the quote, error message will appear.

Cause

Expected Behavior.

Resolution

  • On Item Added event happens at the end of the pipeline of adding a product to the quote
    • This event will be executed for all the products in the hierarchy including attributes marked as line items
  • While Script iterates through all the products being added and execute the "after item added" event on all of them, if some of the scripts changes the number of child items that are currently being added to the quote, error will be thrown
  • CPQ Currently do not support a use case where it is required to reconfigure item that is being added.

Keywords

Script, Quote, Product, Configurable, Error, Limitation, CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Bug Filed

Product

SAP CPQ 2024