CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Record a timestamp when editing a record

Print topic Send  topic

Author Message
gplatek

Posts: 2
Posted: 05/05/2005, 2:45 PM

I have a timestamp textbox in an editable record form with a default value of CurrentDateTime which works very nice when adding a new record, but not when editing an existing record. My goal here is to be able to see when a record was last changed. This only works for when a new record is created though. If I edit an existing record, I just see the original DateTime stamp in the textbox. Obviously it is just reading this from the database and ignoring the default value. How can I force the default value to populate the field every time? I originally tried using the MySQL "timestamp" data type but that looks horrible: 20050505164401. Thats May 5, 2005 4:44:01PM. ugly!
_________________
-Greg
View profile  Send private message
Nicole

Posts: 586
Posted: 05/06/2005, 1:42 AM

Greg,
A value from Default Value property is really applied only in insert mode. In Edit mode you need to create Before Build Update event and assign a default value there
  
$form_name->ds->date_field->SetValue(CCParseDate(date("y-m-d"),  Array("yy", "-", "mm", "-", "dd")));  
BTW, you can use Hidden control instead of textbox and hide date value. Or select display date format in Format property to output formatted date value.


_________________
Regards,
Nicole
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.