Home » Developer & Programmer » Forms » POST-TEXT-ITEM trigger problem
POST-TEXT-ITEM trigger problem [message #85845] Wed, 04 August 2004 00:56 Go to next message
rita
Messages: 41
Registered: April 1998
Member
Hi,

  Can anybody suggest a good trigger that I can use in a text box. The operation that i intend to use in the text box is when the user changes the value in the text box, I call a Procedure that updates that value in the Database table with a commit. However ,so the moment the user changes the value and presses enter it should go to the next item, before which it updates the DB. It works fine in the KEY-NEXT-ITEM trigger. However, one problem is that say the user changes the value in the fld , but does not press tab or enter, but directly F10 to commit. My trigger in the text box(i.e KEY-NEXT-ITEM) does not fire. I tried a POST-TEXT-ITEM , but it does not let me use the ,COMMIT or NEXT_ITEM built ins. I want the trigger to fire the moment the user exits the item and also it should go to the next item in the form

 

Thanks
Re: POST-TEXT-ITEM trigger problem [message #85847 is a reply to message #85845] Wed, 04 August 2004 02:47 Go to previous messageGo to next message
Rohit
Messages: 43
Registered: January 2002
Member
use the when-validate-item trigger for the same
Re: POST-TEXT-ITEM trigger problem [message #85852 is a reply to message #85847] Wed, 04 August 2004 03:52 Go to previous messageGo to next message
rita
Messages: 41
Registered: April 1998
Member
Hi ,

when validate also does not allow Commit. Infact I have the commit written in a Procedure which is called in the when-validate-item trigger. It gives the error illegal reference to commit.

Any other?
Re: POST-TEXT-ITEM trigger problem [message #85864 is a reply to message #85845] Thu, 05 August 2004 06:14 Go to previous messageGo to next message
MNRaju
Messages: 6
Registered: July 2004
Junior Member
Hi,
You call the procedure in KEY-NEXT-ITEM only. Use the following logic when the user presses F10 immediately after the change.
Assume TXT_EMPNO is the field and CONFIRM_CHANGES is the procedure you are calling in KEY-NEXT-ITEM trigger of TXT_EMPNO.Use the following code in KEY-COMMIT trigger in the beginning:

IF GET_ITEM_PROPERTY('TXT_EMPNO', ITEM_IS_VALID) = 'FALSE' THEN
CONFIRM_CHANGES;
END IF;

With the above, you’ll be able to commit the change in the text item even the user presses F10 before pressing TAB key.
Re: POST-TEXT-ITEM trigger problem [message #85868 is a reply to message #85845] Fri, 06 August 2004 04:37 Go to previous messageGo to next message
alessandra
Messages: 3
Registered: January 2003
Junior Member
Put in Key-commit the same you put in
key_next_item.
Re: POST-TEXT-ITEM trigger problem [message #85885 is a reply to message #85864] Sun, 08 August 2004 22:09 Go to previous messageGo to next message
Neeti
Messages: 7
Registered: November 2001
Junior Member
Hi Raju,

Would ITEM_IS_VALID work for a non DB block as well. Never used this before. My KEY-COMMIT trigger is already huge and hence has slowed down the commit processing of my form, since it is a non DB block and had to do many validations there. So needed to know what this does before I make the change.

Thanks
Re: POST-TEXT-ITEM trigger problem [message #85999 is a reply to message #85852] Thu, 19 August 2004 21:26 Go to previous messageGo to next message
prashant
Messages: 122
Registered: September 2000
Senior Member
Don't you think u r using a wrong approach here. Y don't u try using triggers. Its a lot easier and full proof.
I try to put as many validations and updations at the databse level.:-)
Re: POST-TEXT-ITEM trigger problem [message #86002 is a reply to message #85845] Fri, 20 August 2004 00:50 Go to previous message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
Amke a Key-Commit trigger in your form and call you procedure in it as follows:

If :system.block_status in('New','Changed') then
call_procedure;
End If;

This is on assumption that the feild whose value you are changing is a DB feild and your block is a DB block & not control feild/block.
HTH
regards
Himanshu
Previous Topic: Convert 30 lakhs records in .txt to Oracle database
Next Topic: Should i use oracle forms or sql loader
Goto Forum:
  


Current Time: Sun May 19 08:07:28 CDT 2024