This content has been marked as final. Show 9 replies
pls check ur current data block &its items resides..
Is its "Query allowed" property set to "Yes
Clear_Message;Instead of null...
if u r having go_block & go_item somewhere in ur form u could use
SYNCHRONIZE before and afterHope it works...
Edited by: Amatu Allah on Apr 23, 2013 3:29 AM
Maybe this is impossible to do.. In fact I need builtin that operates like EXIT_FORM to place in my on-error trigger. That's why i needed an alternative to EXIT_FORM.
Code of on-error-trigger:
IF :system.mode='ENTER-QUERY' and error_code = 41009 THEN
Exit_Form; -- <== EXIT_FORM doesn't work in on-error trigger :(
Thanks anyway :)
I have a problem with enter query mode. Let say i'm in the enter query mode, and i click on a button. I will get the error FRM-41009 displayed.What is the code in your Button's When-Button-Pressed (WBP) trigger? Perhaps you should check to see if the Form is in Query Mode in your WBP rather than try and supress the error? In other words, eliminate the error - don't supress it. :)
If you would rather supress the error, there is a technique to calling Restricted Built-ins from a trigger that doesn't allow them. You do this through the use of a zero millisecond Timer. For example:
/* Sample On-Error Trigger */ DECLARE n_err_cd NUMBER := ERROR_CODE; t_on_error TIMER; ZERO NUMBER := 0; BEGIN IF ( n_err_cd = 41009 ) THEN /* Create Timer to execute Exit_Form() */ /* to Cancel Query-Mode. */ t_timer := Create_Timer('ON_ERROR', ZERO, NO_REPEAT); ELSE /* Handle all other errors here... */ END IF; END;
/* Sample When-Timer-Expired Trigger */ DECLARE v_Timer VARCHAR2(30); BEGIN v_timer := Get_Application_Property(TIMER_NAME); IF ( v_timer = 'ON_ERROR' ) THEN /* Notice, the timer name is case sensative! */ Exit_Form; END IF; END;
I'm aware that i can press F4 to exit this mode but i dont want to make the user do it each time as i'm sure i'll get complaints.Well, this is just standard Oracle Forms functionality. If you put the Form into Query Mode - you must either execute a query or cancel the Query Mode! That's how it works. Your users need to understand this and accept it - just as they accept the functional characeristics of other programs. ;) Another option would be to add a "Cancel Query" button to your form and make it so it is only enabled when the Form is put in Query Mode. Just a thought...
Personally, I prefer to prevent the occurance of an error rather than suppress the error. :)
Hope this helps.
There was different buttons. Some having some specific coding. And some others to duplicate lines, query ect.
CraigB wrote:What is the code in your Button's When-Button-Pressed (WBP) trigger?
Both the timer and the cancel button worked! The timer is a very nice solution :)
Thank you for your help. (y)
Edited by: MichaelR on 23-Apr-2013 21:04