Home » Developer & Programmer » Forms » Update USER/SYSDATE from FORM
Update USER/SYSDATE from FORM [message #240893] Sun, 27 May 2007 06:15 Go to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Hi all,

I have a form that has a BLOCK with 4 database items. 2 items are displayed and 2 other items (USER db item, DATE db item) are not displayed.

When I update the other items from the FORM, I want to also update the USER (database column) and the DATE ($$DATE$$). I have set Initial Values for both items and both have the Column Name property set to the proper Database Table Field. But still it is NOT updating those 2 fields in the Table???

I have a "WHEN-BUTTON-PRESSED" trigger on a submit button, just to commit.

Can someone tell me the trick?

thanks
Re: Update USER/SYSDATE from FORM [message #240913 is a reply to message #240893] Sun, 27 May 2007 09:59 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Display 'user' and 'date' items in the form to check whether they are correctly populated.

As you've said that you'd like to update values of those columns after first two, displayed items are updated, how did you do that? Did you try to set those values in the PRE-UPDATE block-level trigger? Such as
:user_name_column := get_application_property(USERNAME);
:date_time_column := sysdate;
Don't forget to set 'date_time' column's 'Data Type' property to "Datetime" (if you'd like to save time portion as well).

By the way, what's the purpose of the WHEN-BUTTON-PRESSED trigger if it only commits changes? That's what "Save" button is (and can be found on the default toolbar).
icon14.gif  Re: Update USER/SYSDATE from FORM [message #240956 is a reply to message #240913] Mon, 28 May 2007 01:09 Go to previous message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Littlefoot,

You're the man, this for sure works. But I thought that as long as the Items belong to a DB block and although these items are not Displayed (but have default INITTIAL VALUE) then when the Record is UPDATED it should update the related Database Fields for the User and Date with the initial values. I thought that it should work without the PRE-UPDATE trigger.

Thanks again buddy.

Regards
Previous Topic: How can I update record in the block that Data Source is PACKAGE?
Next Topic: LOV
Goto Forum:
  


Current Time: Thu Feb 13 02:18:43 CST 2025