How to assign a value after clearing a record [message #377607] |
Tue, 23 December 2008 18:34 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 #377694 is a reply to message #377607] |
Wed, 24 December 2008 05:27 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 #377723 is a reply to message #377710] |
Wed, 24 December 2008 11:35 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 Go to previous message](/forum/theme/orafaq/images/up.png) |
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
|
|
|