Home » Developer & Programmer » Forms » Frm-41009 function key not allowed ,press ctrl+k for list of valid values (oracle forms 6i,apps 11.5.10)
Frm-41009 function key not allowed ,press ctrl+k for list of valid values [message #425130] Wed, 07 October 2009 12:22 Go to next message
consultant19
Messages: 23
Registered: September 2009
Location: India
Junior Member
Hi All,

I have a custom form which has cancel button in it .

when i click on cancel it should ask
Do you want to save pending changes
yes ,no,cancel buttons

if yes button is pressed it save changes for the form.
if no form should be closed

but when i click on NO button it is giving me error
Frm-41009 function key not allowed ,press ctrl+k for list of valid values

code in cancel button is
DECLARE
  l_button INTEGER;
BEGIN
  fnd_message.set_string('Do you want to save pending changes?');
  l_button_selection := fnd_message.question('Yes', 'No','Cancel', 1, 2,'question');
  IF l_button_selection = 1 THEN
     DO_KEY('COMMIT_FORM');
  ELSIF l_button_selection = 2 THEN
     DO_KEY('CLOSE_FORM');
  ELSE
     NULL;
  END IF;
END;


[EDITED by LF: formatted code and applied [code] tags]

[Updated on: Wed, 07 October 2009 13:16] by Moderator

Report message to a moderator

Re: Frm-41009 function key not allowed ,press ctrl+k for list of valid values [message #425137 is a reply to message #425130] Wed, 07 October 2009 13:15 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What happens if you use EXIT_FORM instead of CLOSE_FORM? Besides, why DO_KEY? Why don't you simply call these procedures (commit, exit) by name?
Re: Frm-41009 function key not allowed ,press ctrl+k for list of valid values [message #425146 is a reply to message #425137] Wed, 07 October 2009 15:20 Go to previous messageGo to next message
consultant19
Messages: 23
Registered: September 2009
Location: India
Junior Member
Thank you sir,
I didnt do that way, I will try and will let you know

Re: Frm-41009 function key not allowed ,press ctrl+k for list of valid values [message #425151 is a reply to message #425146] Wed, 07 October 2009 15:50 Go to previous messageGo to next message
consultant19
Messages: 23
Registered: September 2009
Location: India
Junior Member
Hi Sir,

I have read in Oracle Applications Developer guide that

dont directly use EXIT_FORM

always use DO_KEY(EXIT_FORM);

Pl let me know ,if I am going wrong, as i am new to Oracle forms.

Pl suggest which one to follow.

if we use DO_KEY('EXIT_FORM'),do we need to use KEY-EXIT triiger ,if so what code should i add in KEY-EXIT trigger
Re: Frm-41009 function key not allowed ,press ctrl+k for list of valid values [message #425355 is a reply to message #425151] Thu, 08 October 2009 13:05 Go to previous message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't know Oracle Applications, so I don't know anything about the suggestion you've mentioned. Sorry.

If you EXIT_FORM in the button trigger, you don't need KEY-EXIT trigger. This trigger is used if you want to do something "special" while exiting the form.

This is what I have had on mind:
DECLARE
  l_button INTEGER;
BEGIN
  fnd_message.set_string('Do you want to save pending changes?');
  l_button_selection := fnd_message.question('Yes', 'No','Cancel', 1, 2,'question');
  IF l_button_selection = 1 THEN
     commit;
  ELSIF l_button_selection = 2 THEN
     exit_form;
  ELSE
     NULL;
  END IF;
END;
Previous Topic: FRM - 40600 Record has already been inserted ... strange problem
Next Topic: Database Menu
Goto Forum:
  


Current Time: Thu Dec 08 01:53:49 CST 2016

Total time taken to generate the page: 0.13154 seconds