Home » Developer & Programmer » Forms » How to assign a value after clearing a record (Forms 6i)
How to assign a value after clearing a record [message #377607] Tue, 23 December 2008 18:34 Go to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
Hello,

I have a form with a few items on it (from different data blocks). I have a button called CLEAR_RECORD. When I insert a record, I click Clear Record to prepare form for inserting another one. But, I would like just after clearing that record, to have one item populated with sysdate. I mean, I would like to have always that item populated with sysdate.

I used WHEN-NEW-FORM-INSTANCE trigger with :item:=sysdate code. It works when I open a form, insert a record, exit a form, then open it again. I am trying to have item assigned with the value, after I clear all other items.

Do you have any advice, which trigger to use, or anything else?
Re: How to assign a value after clearing a record [message #377613 is a reply to message #377607] Tue, 23 December 2008 22:07 Go to previous messageGo to next message
dhanuka.rajesh
Messages: 49
Registered: March 2008
Location: Mumbai
Member
You can use Initial property of Text-Box-Item.


Regards,

Dhanuka. Rajesh
Re: How to assign a value after clearing a record [message #377694 is a reply to message #377607] Wed, 24 December 2008 05:27 Go to previous messageGo to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
I did that, but it doesn't work, because that item is in detail block, it can only work if you go to that item with the mouse (then it will get initial value). (I got already created structure of tables and data blocks, so I am trying to adjust to new demands).
Re: How to assign a value after clearing a record [message #377710 is a reply to message #377694] Wed, 24 December 2008 07:54 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
WHEN-NEW-RECORD-INSTANCE?
Re: How to assign a value after clearing a record [message #377723 is a reply to message #377710] Wed, 24 December 2008 11:35 Go to previous messageGo to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
Littlefoot wrote on Wed, 24 December 2008 07:54
WHEN-NEW-RECORD-INSTANCE?


Also tried that (the same thing is with all when-new-smth triggers). It just works when I go to that item with the mouse. Then it gets a value.

I am trying now to figure smth out with global variables...
Re: How to assign a value after clearing a record [message #377727 is a reply to message #377607] Wed, 24 December 2008 11:54 Go to previous message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
Guys just to inform you, I solved it, in another way.
I have one text item on a form (from master block) which I always have to type a value whenever I want to insert a new record (it's a title of the record). As you now, the problem was with the items from a detail block I couldn't automatically assign a value (date) after cleaning a record. So I put a code in POST-TEXT-ITEM trigger of the master-block item (title) and when I clean a record, and type a new title, and commit form, it inserts I value I wanted. Thank you very much for your patience for listening my problem. I'll be back probably Razz
Previous Topic: Inserting into schema of currently logged in user
Next Topic: modifying oracle JAR files
Goto Forum:
  


Current Time: Fri Dec 09 00:22:25 CST 2016

Total time taken to generate the page: 0.08210 seconds