I am saving a calculated value inside an editable grid such as column A - B to item as shown below
a!textField( value: if(todecimal(ri!items[ri!index].current)=0,"",dollar(todecimal(ri!items[ri!index].current)-todecimal(ri!items[ri!index].Lastmonth))), saveInto:{ ri!items[ri!index].difference, a!save(ri!itemstoken,append(ri!itemstoken,save!value)) }, readonly:true() ),
after this i am writing ri!items to a similar CDT . somehow this calculated value is not saving into the CDT.
Both are decimal values but somehow it is not writing this calculated value to CDT
Discussion posts and replies are publicly visible
Value expression executes while displaying. The save/saveinto gets executed only when something is changed in the associated field.
So, what you see on the UI is not being saved.
To test this out under the grid have a textfields displaying the CDT(s) to see how the values are being changed
a!textField( label: "ri!items", readonly: true, value: ri!items )
Thanks .. The given expression is insde a rule!UHC_showItemRowEach. I am calling the rule from an interface where i have the submit button . so i cannot get the same index value inside the button ( or can i ? )
rows: a!applyComponents( function: rule!UHC_showItemRowEach( items: local!items, index: _, itemstoken: local!itemsToken ), array: if( or( isnull( local!items ), count( local!items ) < 1 ), {}, 1 + enumerate( count( local!items ) ) ),