Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Predefined actions

Events. Save old data in another table

Scroll Prev Next More

 

Save old data in another table action allows saving the old data in another table when the record is updated or deleted. This table should be a part of the project.

 

Available in following events:

Edit page: Before record updated

List page: Before record deleted

save_old_data_in_another_table_select_action

 

Example 1. Direct SQL query

 

 

'**********  Save old data record in another table (VB) ************
dim data
data = XVar.Array()
data("make") = oldvalues("make")
data("model") = oldvalues("model")
data("price") = oldvalues("price")
DB.Insert("copy_of_cars", data)

Example 2. Database API

 

 

 
//**********  Save old data record in another table (C#)  ************
dynamic data = XVar.Array();
 
data["make"] = oldvalues["make"];
data["model"] = oldvalues["model"];
data["price"] = oldvalues["price"];
DB.Insert("copy_of_cars", data);

 

 

See also:

Database API

Database API: Insert        

Save new data in another table

Insert a record into another table