Home » Developer & Programmer » Forms » After post trigger go to the specific item. (Oracle Forms 10g)
After post trigger go to the specific item. [message #576824] Fri, 08 February 2013 04:00 Go to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
I have this layout

http://img339.imageshack.us/img339/975/capturetbo.png

and a post trigger insert and update

                IF  :item1 IS NULL
		AND :item3 IS NOT NULL THEN
				alert_id := FIND_ALERT('blank_alert');
				SET_ALERT_PROPERTY(alert_id,ALERT_MESSAGE_TEXT,'Item3 must have a value.');
				v_alert := SHOW_ALERT(alert_id);		
				RAISE Form_trigger_Failure;
		END IF;


My problem was as it fires, the cursor will be on the item1.
I've already use
SET_ITEM_INSTANCE_PROPERTY
NEXT_ITEM
GO_ITEM

but it was all illegal. The cursor must be in the item3.

Don't question me why I do not set the item3 to required and why post triggers. Very Happy
It is just that. Very Happy It is the requirement.
Any bright Idea? Thanks!
Re: After post trigger go to the specific item. [message #576825 is a reply to message #576824] Fri, 08 February 2013 04:01 Go to previous messageGo to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
And even when-validate-item triggers. It must be post triggers.
Is it possible? Thanks.
Re: After post trigger go to the specific item. [message #576826 is a reply to message #576825] Fri, 08 February 2013 04:17 Go to previous messageGo to next message
Littlefoot
Messages: 19314
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I can't see the image because of our security policy. Please, get used to attach images to your messages - don't post links to them.

Code you wrote and words you used collide. Code says
... and :item3 is NOT null
while alert says
item3 must have a value

That doesn't make sense - alert will be displayed if item3 is NOT null so it obviously has some value. What's the point?

I don't understand what "post trigger insert and update" is/are.

The simplest way of making items required is to set their "Required" property to "yes" - but you don't want to do that.
Validation should be done in WHEN-VALIDATE-ITEM triggers, not "post whatever-you-call-them".

As of "it was all illegal" - you can't use restricted procedures in "post" triggers anyway; read upon these procedures in Forms Help.

As you chose not to use two valid options I can think of, I'm afraid you'll have to wait for someone smarter than me to assist.

P.S. Saying that "it is the requirement" - who said so?

[Updated on: Fri, 08 February 2013 04:18]

Report message to a moderator

Re: After post trigger go to the specific item. [message #576924 is a reply to message #576826] Sun, 10 February 2013 21:26 Go to previous messageGo to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
Thanks for the reply Littlefoot.
It was solved already. I was helped by someone.
(It is the requirement for us in this activity.)

POST-TRIGGER
DECLARE
timer_id				   TIMER;
one_second 		            NUMBER := 1000;
BEGIN
<validations . . .>
timer_id := CREATE_TIMER('timer', one_second,NO_REPEAT);
END;


WHEN-TIMER-EXPIRED
GO_ITEM


Sorry for the typo error. That should be
IF  :item3 IS NULL
		AND :item1 IS NOT NULL THEN

Re: After post trigger go to the specific item. [message #576933 is a reply to message #576924] Sun, 10 February 2013 23:59 Go to previous message
Littlefoot
Messages: 19314
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm glad you made it work. Moreover, thank you for sharing the solution with us.
Previous Topic: Unwanted "Please Acknowledge" message
Next Topic: how to get Menu Item Name ?
Goto Forum:
  


Current Time: Fri Jul 25 11:49:40 CDT 2014

Total time taken to generate the page: 0.12156 seconds