Not able to save calculated value into local variable

Certified Senior Developer

I am trying to calculate and save the value into local variable called local!grandtotal  using below code.

In the user interface I am able to see the value updated, But I am not able to see the value updated in the local variable.

Please advise some suggestions to resolve this.

  Discussion posts and replies are publicly visible