Saving to data detail table and to a history table too.

Saving to data detail table and to a history table too.

  

I'm new to Outsystems and when I save an edit to a detail table entry, I need to add a row to a history table if data has changed.  Right now I'm looking at using screen variables and then doing an update with an SQL insert.  Is there an easier way to do this?  Thanks.

Don't know if this is the best way but I solved it like this

- in the preparation, saved the current record in a local variable

- in the save, compare the local variabel and the widget record. If different, insert in the logging table. Have a look at the answer of André in this post: https://www.outsystems.com/forums/discussion/5802/compare-two-records-to-find-different-atrributes/


Hope this helps.

Solution

I would suggest to do it in the save action.

In the save do a getforupdate.

Check the differences etc.

Save the record.



Solution