Date/Time Record Created & Last Modifed

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mikejan
User
Posts: 4

Date/Time Record Created & Last Modifed

Post by mikejan »

New user, great script!

I see the auto-update value for "ew_CurrentDate" So that works with 'mast modified' But what about the date/time record was originally created? Looking to have like: Name, Phone, Date Modified, Date Created

Thanks!


danielc
User
Posts: 1601

Post by danielc »

Use "Default Value" for Add Page if you want to add "ew_CurrentDate" to Date_Created field as you do not want to modify it in Edit Page. See Field setup in help file.

Or Add default value for Edit Page/Add Page, in Row_Updating/Row_Inserting server event:
$rsnew["yourfield"] = ew_CurrentDate(); // to set current date

See Server event and Client script in help file.


mikejan
User
Posts: 4

Post by mikejan »

THANKS! for the reply. I think I follow you, will see what I can come up with.


fbachofner
User
Posts: 70

Post by fbachofner »

You would probably be much better off to put such functionality into the DB directly with triggers or whatever similar functionality your DB supports.

The benefits are multifold, but probably the best is that you don't need to keep creating the solution for each different client application (assuming you might have more than one over time).

We try to put as many default values in via the DB as possible.


Post Reply