Gossamer Forum
Home : Products : DBMan : Customization :

Update Date?

Quote Reply
Update Date?
Does anyone have any idea how I can do this:

When you view a record in the "record_long" procedure of a specific users record what can I do to say something like this: "rec{'CompanyName'} fields were last updated on ????".

I know there are some examples of "last database update" on the DBMAN FAQ site but all those are for the whole database and not just a specific user.

Quote Reply
Re: Update Date? In reply to
Search this forum for modified date and there are some Threads where codes have been posted for putting a "ModifiedDate" field in the %db_def hash in the default.cfg that you can use to show when the record was last modified.

Regards,

Eliot Lee
Quote Reply
Re: Update Date? In reply to
Sorry Anthro but I'm really confused by what you've said.
I've done a search on "modified date" like you suggested but I've only found solutions for the "whole database" and not just a "specific user".

Can you be more specific please.

Quote Reply
Re: Update Date? In reply to
1) ADD a field called ModifyDate in your %db_def hash! This field shoud BE exactly as the Date field, but with a different field number!

2) Then UPDATE your database with the new field you just added. Don't know how to do that??? Then search this forum for updating existing database.

3) Then in your sub html_record_form routine in the phtml.pl file, add the following codes:

Code:

<input type="hidden" name="ModifyDate" value="$rec{'ModifyDate'}">


4) Then in your sub html_record routine(s), add the following codes:

Code:

Date Modified: $rec{'ModifyDate'}


Got it? Trust me...similar codes have been posted before...and for narrowing your search of the forums...specify ALL POSTS in the DATE RANGE and also SELECT a HIGHER NUMBER like 200 for the Hits AND also SELECT the DBMAN Customization Forum.

Regards,

Eliot Lee
Quote Reply
Re: Update Date? In reply to
Thanks for that.

I'll try it out and let you know how I get on.

Quote Reply
Re: Update Date? In reply to
Philip:

If you want the last modified field to be automatically updated when someone modifies their record you will also need to add:

In html.pl, sub html_modify_form_record, just after the line that starts with

if (!%rec) { &html_modify_failure(

add

$rec{'Last Modified'} = &get_date;

Changing $rec{'Last Modified'} to the actual name of your field.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Update Date? In reply to
Oh thanks for that Lois I do want that.

Cheers Smile

Quote Reply
Re: Update Date? In reply to
Can the last modified field also be automatically updated if a record is deleted?

If so what code would be needed and where would it go?

Quote Reply
Re: Update Date? In reply to
If the record is deleted, where is the modified date going to be stored?