Hi - While changing value using a!save(), I see different output for a!buttonWid

Hi - While changing value using a!save(), I see different output for a!buttonWidget() and a!buttonWidgetSubmit(). Isn't it a weird behaviour? But, I am facing this issue. itemsCart is an array of defined CDT where vehicle is a field. When I code inside a!buttonWidgetSubmit() then value is coming as repeated (which is equal to number of records in itemsCart). But, I am getting correctly when I put this code inside a!buttonWidget(). Please find the attached code. I have given sample value as well. Please share your thought. Thanks.


Code.txt

OriginalPostID-167232

OriginalPostID-167232

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi Rajesh, I guess it is not a problem with buttonWidget or buttonWidgetSubmit. It is problem with how you are saving a value into a field in the CDT. "ri!itemsCart.vehicle" is an array type. So we could not save direct value into array type variable. You might save like "a!save(ri!itemsCart.vehicle, {"91524",""})" or depends on your requirement.
Reply
  • 0
    Certified Lead Developer
    Hi Rajesh, I guess it is not a problem with buttonWidget or buttonWidgetSubmit. It is problem with how you are saving a value into a field in the CDT. "ri!itemsCart.vehicle" is an array type. So we could not save direct value into array type variable. You might save like "a!save(ri!itemsCart.vehicle, {"91524",""})" or depends on your requirement.
Children
No Data