Symptom
When adding multiple Rows to Container using the method Container.AddNewRow() and calling calculate for the container, container row state is not getting maintained and some inconsistencies are seeing
Environment
SAP SALES CLOUD CPQ
Reproducing the Issue
- Create a Container Attribute and add two products that contain the ItemQuantity Attribute
- Add Container to a Parent/Child product
- Add following script to OnProductLoaded Event:
x=Product.GetContainerByName('Container')
r1 = x.AddNewRow('Prod1')
r1.Product.Attr('ItemQuantity').AssignValue('11')
r2 = x.AddNewRow('Prod2')
r2.Product.Attr('ItemQuantity').AssignValue('22')
r1.ApplyProductChanges()
r2.ApplyProductChanges()
x.Calculate() - Verify that in container, first row is updated, but second still shows old value
- When adding to Quote, Values are correct.
Cause
Coding Issue.
Resolution
- In order to have consistent state in UI as well as in Backend Calculate() should be called for each row that has been added through script.
See Also
Keywords
Container, Script, Configurable, Parent/Child, AddNewRow, Calculate, Configurator, UI, CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Bug Filed
Product
SAP CPQ 2024
SAP Knowledge Base Article - Public