Home » Developer & Programmer » Forms » what trigger to use? (10g r2 ,windows7)
what trigger to use? [message #552903] Mon, 30 April 2012 02:26 Go to next message
7anona
Messages: 72
Registered: February 2012
Member
hello every one,
I am having a text_item1 which gets its value from an LOV, and once the user selects
from an lov I want to get a value in text_item2
based on value in text_item1
(select describtion into :text_item2 from table where :text_item1=code)
I used post-change but it didn't get the value
when-validate_item worked but it only fires when I save
kindly respond as soon as possible
Re: what trigger to use? [message #552905 is a reply to message #552903] Mon, 30 April 2012 02:50 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, POST-CHANGE should not be used; it is here for backward compatibility.

WHEN-VALIDATE-ITEM trigger is the right one. It fires during item validation process (which is, for example, when you navigate out of the item or - as you noticed - when you save changes, but NOT ONLY then).
Re: what trigger to use? [message #552909 is a reply to message #552905] Mon, 30 April 2012 03:11 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
it doesn't fire when I navigate out of the item unless an item in another block in the same
form
Re: what trigger to use? [message #552910 is a reply to message #552909] Mon, 30 April 2012 03:14 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Then you must be doing it wrong.

If possible, copy/paste your code over here. Before doing it, please, have a look here (will take only 10 seconds of your time).
Re: what trigger to use? [message #552912 is a reply to message #552910] Mon, 30 April 2012 03:26 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
	SELECT CODE INTO :text_item2 FROM color WHERE :TEXT_ITEM1=DESCRIBTION; 
Re: what trigger to use? [message #552914 is a reply to message #552912] Mon, 30 April 2012 03:43 Go to previous messageGo to next message
cookiemonster
Messages: 13926
Registered: September 2008
Location: Rainy Manchester
Senior Member
You realise that code does the opposite of what you originally posted?
If when-validate-item only fires when you save then that'll be because of the form level Validation Unit property. Read the form builder help topic on it.

However - why don't you just use the LOV to populate the other item?
Re: what trigger to use? [message #552916 is a reply to message #552914] Mon, 30 April 2012 03:49 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
the user will select the describtion from the lov. i dont want the code to be visible to the user in the LOV niether in form
where the text item will be invisible
i just want it to be saved in the table which the form is based on
Re: what trigger to use? [message #552918 is a reply to message #552916] Mon, 30 April 2012 03:52 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
yes, the previous code was wrong
Re: what trigger to use? [message #552919 is a reply to message #552916] Mon, 30 April 2012 03:52 Go to previous messageGo to next message
cookiemonster
Messages: 13926
Registered: September 2008
Location: Rainy Manchester
Senior Member
OK. So have the LOV populate both items.
Re: what trigger to use? [message #552920 is a reply to message #552919] Mon, 30 April 2012 03:53 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
can the lov populate the code without the code being visible in the LOV?
Re: what trigger to use? [message #552921 is a reply to message #552920] Mon, 30 April 2012 03:56 Go to previous messageGo to next message
cookiemonster
Messages: 13926
Registered: September 2008
Location: Rainy Manchester
Senior Member
yes. just set the columns width to 0 in the LOV.
Re: what trigger to use? [message #552924 is a reply to message #552921] Mon, 30 April 2012 04:01 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
thanks, that was very helpful Smile but can I do it using triggers
the user can adjust the width by dragging
Re: what trigger to use? [message #552925 is a reply to message #552924] Mon, 30 April 2012 04:02 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Dragging? Dragging what? 0 width LoV columns? Did you try to "drag it"?
Re: what trigger to use? [message #552927 is a reply to message #552925] Mon, 30 April 2012 04:06 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
Smile no I haven't! it just came into my mind
thanks again
Re: what trigger to use? [message #552928 is a reply to message #552927] Mon, 30 April 2012 04:07 Go to previous messageGo to next message
cookiemonster
Messages: 13926
Registered: September 2008
Location: Rainy Manchester
Senior Member
The LOV is the correct way to do - try it.
Re: what trigger to use? [message #552930 is a reply to message #552928] Mon, 30 April 2012 04:12 Go to previous message
7anona
Messages: 72
Registered: February 2012
Member
perfect Smile
Previous Topic: Execute query by pressing a button
Next Topic: Deselect all checkboxes except the one which has been selected
Goto Forum:
  


Current Time: Wed Jul 10 00:39:03 CDT 2024