Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Sample events > Database

Store the date and time when a record is modified

Scroll Prev Next More

 

To keep track of the time/date when records were last modified and who made the modification, you have two options:

1. Set the default value under 'Edit as' settings

To store the login name of the user who made the change, set the default value to:

 

$_SESSION["UserID"]

 

To store the modification date and time, set the default value to:

 

now()

 

Note: Make sure to clear the AutoUpdate Value field.

2. Modify BeforeAdd/BeforeEdit events

Add the following code to BeforeAdd/BeforeEdit events:

 

$values["DateUpdated"]=now();
$values["UpdateBy"]=$_SESSION["UserID"];

See also:

"Edit as" settings: Date

About Date Control API

Table events

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software