SAP Knowledge Base Article - Public

3562306 - Quote.GetAllItems() returns items with inconsistency in the order.

Symptom

When using the Quote.GetAllItems() to iterate through Quote Items list, it has been noted that order of items retrieved is not the same for each call. 

Environment

SAP SALES CLOUD CPQ

Reproducing the Issue

  1. Create a script that will use the method Quote.GettAllItems() 
  2. On a quote, add a Parent/Child product
  3. Add a Simple Product
  4. On developer console, check that the order of the items that were retrieved through the script is not the same as in UI, and sometimes it mixes the Child Items with other items.

Cause

Expected Behavior.

Resolution

  • There is no guarantee that GetAllItems() will return items in any specific order
  • If it is required to sort items, it should be done based on value of some item fields (i.e. QuoteItem which represents item number). 

See Also

Keywords

GetAllItems, Scripting, Order, Item, CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Problem

Product

SAP CPQ all versions