SAP Knowledge Base Article - Public

3662777 - Container Row not Getting Updated on Container when adding multiple rows

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

  1. Create a Container Attribute and add two products that contain the ItemQuantity Attribute
  2. Add Container to a Parent/Child product
  3. 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()
  4. Verify that in container, first row is updated, but second still shows old value
  5. 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