Jer
Posts: 25
|
| Posted: 03/10/2008, 3:19 PM |
|
On my tables I've added 3 fields:
datecreated, dateupdated - both are datetime fields.
and updatedby which is an integer field.
I want to add the date and time to the first two fields. For the last, I want to insert the UserID of the current user.
I'm not sure how to go about this without modifying the source code directly.
I've looked at the Events, and I see a "Before Build Insert." The problem is, I'm not sure how to add the code that would insert the values for the 3 fields above.
Any help greatly appreciated.
Thanks,
Jer
|
 |
 |
nhbw19t
Posts: 29
|
| Posted: 03/28/2008, 8:50 PM |
|
Insert mode
the easist way is to make the date fields text instead of a date format.
insert mode
set the db format to yyyy-mm-dd HH:nn:ss or whatever you have set in the db
default value = date("Y-m-d H:i:s")
userid = integer field
default value = CCGetUserID()
update section
add a before update event
retrieve value for control
select your date field
expression
source type - date("Y-m-d H:i:s")
repeat for other date
source type CCGetUserID()
Hope this helps;
----------------------------
On my tables I've added 3 fields:
datecreated, dateupdated - both are datetime fields.
and updatedby which is an integer field.
I want to add the date and time to the first two fields. For the last, I want to insert the UserID of the current user.
I'm not sure how to go about this without modifying the source code directly.
I've looked at the Events, and I see a "Before Build Insert." The problem is, I'm not sure how to add the code that would insert the values for the 3 fields above.
Any help greatly appreciated.
_________________
J.D. Archer
GE Transportation |
 |
 |
|