Create & Update Timestamps

Hi All,

I use create / update timestamps on most of my tables.
I don’t mind displaying the timestamp values, but for updates and adds I have no interest in them being present.
I am using a grid for listing of the records which shows the timestamps.
When I go to the Add form how do I hide those columns?
Also, how do I default the current timestamp for the insert. I am using PostgrSQL and I know as part of the SQL I can pass the value of “current_timestamp” and all is good. I am just struggling to figure this out.
Is there a sample project somewhere that does this that I can use to guide me?

Thanks,

Craig

Can’t you just remove those timestamp fields from the form?

Hi nwdbs,

Yes, I can remove them from the grid, but they are on the Add/Edit screen and I have to manually supply values for the columns.
In most applications I (we?) use these columns are hidden and are automatically updated with current timestamps (create or update). That is what I am trying to accomplish: Hide them and populate the create timestamp column on inserts and populate the update timestamp on, well, updates.
So my question is:
How do I hide them so they don’t show up on the Add/Edit screen?
How do I populated them?

Thanks,

Craigbert

The “Add/Edit screen” is a Form Application, correct?

Thanks nwdbs, that helped me sort out the answer to my first question. :grinning:
On that form I have defined in Form Settings => Edit Fields
for the Create Timestamp “DB Value (insert)” = Datetime of insert
and the Update Timestamp “DB Value (update)” = Datetime of update
But those don’t seem to be doing the trick.

1 Like

Is there a way to intercept the INSERT or UPDATE SQL in the onBeforeInsert or onBeforeUpdate events so that I can set those fields to “current_timestamp”?

You shouldnt have to… if they are set on the Edit Fields section…
Got a screenshot of what that looks like?