Delete Multiple Records [message #606446] |
Fri, 24 January 2014 00:21 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
Dear Folks,
Attached is my designed form & below is my code on delete button.
The problem is that 1 or more less records are deleted from selected, i.e when i select 5 record 3 records are deleted, when i select 2 records 1 record is delete. but when i select one record definately 1 record deleted.
Please help.
BEGIN
GO_BLOCK('CASEDISCHARGE_vu');
First_Record;
LOOP
IF :CASEDISCHARGE_vu.CHECK = 'Y' THEN
SET_BLOCK_PROPERTY('CASEDISCHARGE_vu', DELETE_ALLOWED, PROPERTY_TRUE);
DELETE_RECORD;
END IF;
Exit when :System.Last_Record = 'TRUE';
Next_Record;
END LOOP;
commit;
SET_BLOCK_PROPERTY('CASEDISCHARGE_vu', DELETE_ALLOWED, PROPERTY_FALSE);
set_block_property('CASEDISCHARGE_VU',DEFAULT_WHERE,'CAUSELISTMID='||:GLOBAL.CAUSELISTMID);
GO_BLOCK('CASEDISCHARGE_VU');
EXECUTE_QUERY;
END;
Thanks
Waseem
-
Attachment: disch.png
(Size: 46.60KB, Downloaded 950 times)
|
|
|
|
Re: Delete Multiple Records [message #606513 is a reply to message #606468] |
Sat, 25 January 2014 03:58 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
Resolved.
else condition was missing.
Updated code as follows.
Thanks for response.
IF :CASEDISCHARGE_vu.CHECKED = 1 THEN
SET_BLOCK_PROPERTY('CASEDISCHARGE_vu', DELETE_ALLOWED, PROPERTY_TRUE);
DELETE_RECORD;
ELSE
Next_Record;
END IF;
|
|
|
|
|