Home » Developer & Programmer » Forms » delete_record makes no changes
delete_record makes no changes [message #507077] Thu, 12 May 2011 07:01 Go to next message
Stefan21
Messages: 8
Registered: May 2011
Junior Member
Hi folks

I am using 10g and want to let an user to delete a single record from a multirow form via delete button. This button is supposed to do the same, what the "delete record" button on the default menu does.
(I want a custom menu, so I can't use that button)

My delete button ist assigned to a control-block and the when-button-pressed-Trigger of that button looks like this:

-------------
DECLARE
TEMP VARCHAR(30);

BEGIN
-- Record chosen?
IF :<BLOCK>.ID IS NOT NULL THEN

SELECT <Name of record> INTO TEMP FROM <TABLE> WHERE ID = :<BLOCK>.ID;
-- Confirm!
SET_ALERT_PROPERTY('DEL_CHECK',ALERT_MESSAGE_TEXT,
'Do you really want to delete Record '|| TO_CHAR(TEMP)||' ?');
IF SHOW_ALERT('DEL_CHECK') = ALERT_BUTTON1 THEN
DELETE_RECORD;
commit;

END IF;
ELSE
Message('No ID was selected.');
go_item('<Another Button in control-block>');
END IF;
END;

---------------


The problem is, that the alert asks the user about the previously chosen record correctly, but if the user clicks BUTTON1 the Form says: No changes to save (FRM-40401).

Can anyone help me out?
Re: delete_record makes no changes [message #507079 is a reply to message #507077] Thu, 12 May 2011 07:18 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Delete_record deletes the record the cursor is currently in.
The cursor is the button, which is in the control block. So not in the db record.
You need to use go_block first.
Re: delete_record makes no changes [message #508561 is a reply to message #507079] Mon, 23 May 2011 03:22 Go to previous message
Stefan21
Messages: 8
Registered: May 2011
Junior Member
Thank you, cookiemonster.
Previous Topic: Please provide the materiel for Forms
Next Topic: Raise Error Message
Goto Forum:
  


Current Time: Sat Sep 07 15:38:07 CDT 2024