Home » Developer & Programmer » Forms » When-Timer-Expired (Oracle -10g)
When-Timer-Expired [message #540651] Wed, 25 January 2012 03:45 Go to next message
jixx
Messages: 5
Registered: January 2012
Junior Member
Hello,

I'm having a problem with the When-timer-Expired trigger.
I am creating a timer on the On-Error trigger of the block.
in the when-timer-expired :message(11);exit_form(no_validate);
If i run the program program for the first time,message 11 doesnt show thus it doesnt fire the when-timer-expired trigger. But if i logout from application server and enter all over again,the when-timer-expired works !
Re: When-Timer-Expired [message #540679 is a reply to message #540651] Wed, 25 January 2012 05:43 Go to previous messageGo to next message
Tomcrzy
Messages: 101
Registered: December 2011
Location: Chennai,India
Senior Member

Please put it clearly using coding formats ,The lines you had wrote somewhat confusing.
Re: When-Timer-Expired [message #540681 is a reply to message #540651] Wed, 25 January 2012 05:51 Go to previous messageGo to next message
jixx
Messages: 5
Registered: January 2012
Junior Member
1-	IF NVL(:PARAMETER.P_CALLED,0) <> 0
	THEN
		CALL_TIMER;
2- PROCEDURE CALL_TIMER IS
		v_timer TIMER;
		name1 varchar2(20);
Begin
	IF get_application_property(TIMER_NAME) ='MYTIMER'
	THEN 	Delete_Timer('MYTIMER');clear_message;
	ELSIF get_application_property(TIMER_NAME) ='EXITFORM'
	THEN 	Delete_Timer('EXITFORM');clear_message;
	ELSE NULL;
	END IF;
	v_timer := Create_Timer('MYTIMER', 1, NO_REPEAT);message(55);message(55);
End;
3-DECLARE
	V_NAME		VARCHAR2(20) := NULL;
BEGIN
	message('expire');message('expire');
	IF get_application_property(TIMER_NAME) ='MYTIMER'
	THEN 	Delete_Timer('MYTIMER');clear_message;
	ELSIF get_application_property(TIMER_NAME) ='EXITFORM'
	THEN 	Delete_Timer('EXITFORM');clear_message;
	ELSE NULL;
	END IF;

	:GLOBAL.MANISS1 := 0;
	:GLOBAL.INVMATCH1 := 0;
	:GLOBAL.MANISS := 0;
	:GLOBAL.INVMATCH := 0;
	EXIT_FORM(NO_VALIDATE);
END;	

Please take into consideration that here a form is calling another form.It is inserting data in the background and i am using global parameters to see if there is any errors for rollback to occur for both forms.


CM: added [code] tags

[Updated on: Wed, 25 January 2012 08:03] by Moderator

Report message to a moderator

Re: When-Timer-Expired [message #540686 is a reply to message #540681] Wed, 25 January 2012 05:54 Go to previous messageGo to next message
jixx
Messages: 5
Registered: January 2012
Junior Member
Number 3 is the When-Timer-Expired ...
after the message 55 it is not going to when timer expired
Re: When-Timer-Expired [message #540726 is a reply to message #540686] Wed, 25 January 2012 08:07 Go to previous messageGo to next message
cookiemonster
Messages: 13926
Registered: September 2008
Location: Rainy Manchester
Senior Member
1) Please read and follow How to use [code] tags and make your code easier to read?
2) In what circumstances is call_timed being run?
Re: When-Timer-Expired [message #540735 is a reply to message #540651] Wed, 25 January 2012 08:33 Go to previous messageGo to next message
jixx
Messages: 5
Registered: January 2012
Junior Member
I have program A and program B.

Program A calls program B and fills items found on program B.

If any validations or errors happen on program B,I will rollback and go back to program A without a commit being done Neither on B nor on A.

The error message that should show on validation(when-validate-item) or errors (on-error) should not show in program B.
So i created a timer that will be called on both validation and error which will exit_form(no_validate).

PROCEDURE CALL_TIMER IS
		v_timer TIMER := NULL;
		V_NAME VARCHAR2(20) := NULL;
Begin
	V_NAME := NVL(GET_APPLICATION_PROPERTY(TIMER_NAME),'MYTIMER');
	v_timer := Find_Timer(V_NAME);
	If NOT ID_NULL(v_timer) Then	
		Delete_Timer(v_timer);
	End If;
	v_timer := Create_Timer(V_NAME,1, NO_REPEAT);
End;


it is called on both when-validate-item of every item that enters an exception and on the On-Error trigger.

On trigger, When-Timer-expired,
:GLOBAL.MANISS1 := 0;
:GLOBAL.INVMATCH1 := 0;
:GLOBAL.MANISS := 0;
:GLOBAL.INVMATCH := 0;
EXIT_FORM(NO_VALIDATE);


The on-error trigger is calling the procedure Call_timer but after the timer is created,the When-timer-expired trigger is not fired up.What should be done?
Re: When-Timer-Expired [message #540739 is a reply to message #540735] Wed, 25 January 2012 08:43 Go to previous messageGo to next message
Gogetter
Messages: 39
Registered: December 2009
Location: Cologne Germany
Member
Hi,

I create a form with
1. PROCEDURE CALL_TIMER
2. Button With When-Button-Pressd Trigger which is callin Call_Timer
3. WHEN-TIMER-EXPIRED on Form Level with your code

When pressing button, anything goes fine.
I replaced "Exit Form" with a message - anything fine.

[Updated on: Wed, 25 January 2012 08:43]

Report message to a moderator

Re: When-Timer-Expired [message #540741 is a reply to message #540739] Wed, 25 January 2012 08:49 Go to previous messageGo to next message
jixx
Messages: 5
Registered: January 2012
Junior Member
If you are on a button it could be done, but i am on a block On-Error trigger...I can't go_block or go_item...
Re: When-Timer-Expired [message #540746 is a reply to message #540741] Wed, 25 January 2012 09:02 Go to previous message
Gogetter
Messages: 39
Registered: December 2009
Location: Cologne Germany
Member
okay,

I added a text item (Number) with on-error-tigger on item level and entered a char. Error raise, and exit form works.
I moved the on-error-trigger to block level, and exit form works fine here too.

I think there are other circumstances in your form which may block the exit or raise other errors?

Will read your answer tomorrow

Regards Rudi




Previous Topic: various beginner forms questions [merged 3 by jd]
Next Topic: Hierarchical Tree
Goto Forum:
  


Current Time: Mon Jul 15 17:53:56 CDT 2024