Home » Developer & Programmer » Forms » Form Save related Query
Form Save related Query [message #563224] Fri, 10 August 2012 02:45 Go to next message
JAYATIRC
Messages: 1
Registered: July 2012
Junior Member
I have created a form where the main canvas has number of buttons. When I click each button it will open a new canvas in a new window. User will enter some details there. now I want to force the user to save or discard the record before they leave that child window. The code I have written is


DECLARE
n_button_selection INTEGER;
BEGIN
IF :SYSTEM.BLOCK_STATUS = 'CHANGED' then
fnd_message.set_string('Do you want to save the changes on Post Block?');
n_button_selection := fnd_message.question('Yes', 'No','Cancel', 1, 2,'question');
IF n_button_selection = 1 THEN
standard.commit; --commit_form;-- APP_STANDARD.EVENT('KEY-COMMIT');
ELSIF n_button_selection = 2 THEN
RAISE form_trigger_failure;
ELSE
null;

END IF;
end if;
END;





But I am not sure in which trigger I need to write the code. When I am writting in post block it is behavior is becoming unpredictable and also APP_STANDARD.EVENT('KEY-COMMIT') does not work in post_block trigger. When I am writting this in ON close trigger then also it is not firing as expected. please help me.
Re: Form Save related Query [message #563237 is a reply to message #563224] Fri, 10 August 2012 06:12 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you try WHEN-WINDOW-CLOSED?
Previous Topic: date format
Next Topic: Date Function Ora-01841(full) year must be between
Goto Forum:
  


Current Time: Thu Jul 04 15:47:21 CDT 2024