Retain old values with grid editable

Hi, i have a grid type editable, and i need retain original values of 2 fields, so that i created 2 fields personalized type money for each field.
{VALUE1_OLD} and {VALUE2_OLD} and in event onloadrecord, onbeforeupdate and onbeforeinsert, i assig:

{VALUE1_OLD} = {VALUE1};
{VALUE2_OLD} = {VALUE2};

But that only works when i insert a new record. The news fields update to new values.
If i update a record the assignment do not works!. I can see that the news fields have original values and not update to news values.

Any idea how can i fixed?

i know what is the problem, i create first 2 attributes with the same name and it do not wirks, then i delete that attributes and i create 2 field with the same name, I think that is a conflict with that variables.

Then i create 2 fieds with other names and works fine.

Hi Alvagar,

did you fix your problem ? I’ve got a similar one and all the calculation are correct except that I’m not able to update the shown value on the grid.
Could you please suggest me how did you solve it ?

Hello
Right now the solution is

$this->nmgp_dados_form[name_filed]

Use:
Onafterupdate
if ( $this->nmgp_dados_form[field] != {field} and !empty( {field} ) ) {
echo ‘The value is different’;
}