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
- Create a script that will use the method Quote.GettAllItems()
- On a quote, add a Parent/Child product
- Add a Simple Product
- 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