Numbering in multi data block Oracle Forms 11g [message #656032] |
Wed, 21 September 2016 03:22  |
 |
avni
Messages: 4 Registered: September 2016
|
Junior Member |
|
|
I have a multi data block (6 records) and check box in the same block .
I want to number the records when check box is checked , and when the check box is unchecked , the numbering should rearrange itself in checking order ,
and next checked value should also come in the checking order.
(numbers are displayed in another TextItem in same block )
for example.
values when checked (I am checking all the 6 records in an order) then the TextItem values become
1
2
3
4
5
6
and when I uncheck 3 then it should rearrange as
1
2
3
4
5
and when '1' is unchecked then,
1
2
3
4
And again I am checking the 3rd record then
1
5
2
3
4
And again I am checking the 1st record then
6
1
5
2
3
4
Please help me to do this .I have tried using sequence , but in vain .
|
|
|
|
Re: Numbering in multi data block Oracle Forms 11g [message #656089 is a reply to message #656071] |
Thu, 22 September 2016 05:26   |
 |
avni
Messages: 4 Registered: September 2016
|
Junior Member |
|
|
Dear LittleFoot,
Thanks for your reply .
I have achieved it , thank you again
The real scenario here is , the selection of inventory in clicking order should be available to the next level
supervisor in the same order , so that he can process the inventories based on that order.
And also the first level supervisor need not check the whole record in his screen and can check records in any
order .
I am posting here the query what I wrote in checkbox changed .
DECLARE
P_VAL NUMBER;
P_UVAL NUMBER;
p_max number;
CNT NUMBER:=0;
CH_CN NUMBER:=0;
BEGIN
if :BLK.CHKBX=1 then
if :CHK_CNT= 0 then
begin
--HERE SELECT THE MAX COUNT FROM THE DATABASE TABLE FOR THAT DAY AND STORE IN P_MAX --
if p_max is null then
:CHK_CNT:=:CHK_CNT+1;
:BLK.fm_seq := :CHK_CNT;
end if;
if p_max is not null then
:CHK_CNT:= p_max+1;
:BLK.fm_seq :=:CHK_CNT ;
end if;
exception when no_data_found then
null;
end;
elsif :CHK_CNT >0 then
:CHK_CNT:=:CHK_CNT+1;
:BLK.fm_seq := :CHK_CNT;
end if;
end if;
if :BLK.CHKBX=0 then
:CHK_CNT:=:CHK_CNT-1;
end if;
IF :BLK.CHKBX=0 THEN
P_UVAL:=:BLK.fm_seq ;
:BLK.fm_seq := NULL;
go_block('BLK');
FIRST_RECORD;
WHILE :SYSTEM.LAST_RECORD='FALSE'
LOOP
IF :BLK.CHKBX=1 THEN
P_VAL:=:BLK.fm_seq;
IF P_VAL>P_UVAL THEN -- CURRNT RECORD VAL >UNCHKD VALUE
:BLK.fm_seq :=P_VAL- 1 ;
END IF;
END IF;
NEXT_RECORD;
END LOOP;
FIRST_RECORD;
END IF;
END ;
Regards,
[EDITED by LF: applied [code] tags]
[Updated on: Thu, 22 September 2016 12:54] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: Numbering in multi data block Oracle Forms 11g [message #656118 is a reply to message #656113] |
Fri, 23 September 2016 04:43  |
cookiemonster
Messages: 13965 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
The exception handler looks to be in the wrong place. I assume you want the IFs after the select to run even if it finds no data, in which case the exception section needs to be immediately after select.
Also some ELSE's would simplify the code a bit.
|
|
|