Home » Developer & Programmer » Forms » what is the Built-in for canel query,if it should be controlled programtically
what is the Built-in for canel query,if it should be controlled programtically [message #85344] Thu, 17 June 2004 05:19 Go to next message
Prick
Messages: 11
Registered: June 2004
Junior Member
Hi , all

I want to know that how we can program the menu item for canceling a query if the program is in enter-query mode?

is there any built-in to do that

i tried , abort_query , exit_form....

but all in vain

Can anyone suggest me how to do that

Ram
Re: what is the Built-in for canel query,if it should be controlled programtically [message #85345 is a reply to message #85344] Thu, 17 June 2004 06:17 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
Make a Menu item in your Menu which when pressed should call DO_KEY(EXIT_FORM);
Create a trigger in your form Key-exit & write
Exit_Form(NO_VALIDATE); in it.

HTH

Regards
Himanshu
Re: what is the Built-in for canel query,if it should be controlled programtically [message #85346 is a reply to message #85345] Thu, 17 June 2004 07:08 Go to previous messageGo to next message
Prick
Messages: 11
Registered: June 2004
Junior Member
hi,
It works fine, it cancels query
but i have some points

when ever i press canel query

1. it give a error message
"FRM-41009 Function key not allowed, press cntrl + F1 for the list of valid key's"

2.another message following previous one
"Frm- 40353 query cancelled"

3.I am having key-exit assciated with each of my screen
for some other purpose, but i am using
Exit_form(ask_commit , to_savepoint);
but it only works
when i give
Exit_form(no_validate);
if i use this one the form will be exited and it will
never ask to commit even if it holds the records which need to be committed, and it will never rollback as well.
So what to do
Guide me please, Mr. Himanshu
Ram
Re: what is the Built-in for canel query,if it should be controlled programtically [message #85353 is a reply to message #85346] Thu, 17 June 2004 22:29 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
For your #1
Create a trigger On-error in your Form and add following code:

Begin
if Error_Code = 41009
And :System.Block_status <> 'QUERY' Then
NULL;
End If;
End;

For #2 there is no need of any change.This is a Default informative message.

I could not understand your problem #3.
Are you pressing Cntrl+q.
Try changing the Exit form code as follows:
If :System.Form_status='CHANGED' Then
Exit_form;
Else
Exit_form(No_Validate);
End;

HTH
Regards
Himanshu
Re: what is the Built-in for canel query,if it should be controlled programtically [message #85356 is a reply to message #85353] Thu, 17 June 2004 23:56 Go to previous messageGo to next message
Prick
Messages: 11
Registered: June 2004
Junior Member
hI, HIMANSHU,

According to your suggestion i will supress these two messages in on-error trigger that is fine, OK

Regarding third point

Yes i am using cntrl+q for canceling query because the requirements say's that user should be allowed to canel the query in both way's, either by pressing the the canel query menu item or by pressing relevant function key.

I applied the DO_KEY('exit_form') in the menu item code and i used exit_form(no_validate)
in the key-exit , that's why it works fine when ever user presses menu icon to canel the query.
But if he presses cntrl+q
form suppose to execute the code written in key-cquery
in that trigger i have pasted the same code(ie. enabling /disabling perticular menu items and exit_form built in) as i have done in menu item code
but it does not fire.
i can conclude that i am still not able to achieve the desired functionality after pressing cntrl+q
could you look into it
if i am not able to explain you exactly please ask me i will explain you again

Ram
Re: what is the Built-in for canel query,if it should be controlled programtically [message #85362 is a reply to message #85356] Fri, 18 June 2004 02:47 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Dear Ram,
key-cquery is meant to add Count_query built in & not cancelling the query.
It is the Key-exit trigger which is supposed to fire if you press Cntrl+q or press cancel query button.

If your Form is in enter query mode & you press cntrl+q then it will make it in normal mode.
If you are in Normal mode & press control+q then it will close the form.

So please let me know where you are facing problem.

HTH
Regards
Himanshu
Re: what is the Built-in for canel query,if it should be controlled programtically [message #85369 is a reply to message #85362] Fri, 18 June 2004 05:31 Go to previous message
Prick
Messages: 11
Registered: June 2004
Junior Member
Hi , Himanshu

I am agreed with you, i also found the same thing as you mentioned, when i was debugging the form.
Key-Exit trigger fires when ever i press cntrl+q
and that only canels the query if the mode is
enter-query, key-cqry does not.

I am supressing the error message 41009, and
cancel query icon and cntrl+q is working fine.

I am very thankfull to you that you helped me a lot in this regard.

I am implementing the same logic in all of my screen
but still testing is remaining
i will come back to you if i stuck any where in the testing regarding this cancel query operation

Thanks a lot again
Ram
Previous Topic: Re : values in details form
Next Topic: Oracle Terminal
Goto Forum:
  


Current Time: Tue May 07 17:06:36 CDT 2024