In a Oracle From, there is a Multi record Data block ( Tabular Layout )
and in that block there is a check box item having following properties :
Checked value : Y
Unchecked value : N
Initial value : Y
Now my requirement is, at a time the block will display this checked box item as checked, only for one record. I mean , let say right now the 3-rd one is checked, and user click on the 5-th record to make it checked , now 5-th one will be checked and 3-rd one will be automatically unchecked.
If this is what you want, then make the checkbox part of the data block that yout data record is in. Since the layout of that data block is table layout your checkboxes should appear corresponding to each record as well. Most probably you have created this checkbox as not part of this data block.
Hope it helps, however if I understood your problem incorrectly please explain it greater detail.
Thanks for the reply.
But my requirement is , in to the table the the value for Col2 (which is the checkbox item ) will be 'Y' for only for one record and for rest it will be 'N'.
Using the form if user select one unchecked ( i.e.'N' value) then that value will change from 'N' to 'Y' and it will be now checked one and the current 'Y' will be now 'N' and that will be now uncheked.
Hmmm...this seems sorta odd....do you mind telling me why this is so. I mean given that you are dispaying different rows, you mean to say that the check box should be yes for only on of the rows and no for all the others? This doesnt make sense, cuz what if next time you wanna display 6 rows at a time? What if the user puts a condition that matches all the rows in your table, in that case are you sating that only one checkbox can have the value yes while the rest say no? If you dont mind can you please explain the underlying table structure? Also i am assuming that the value for the checkbox is coming from the table and then going back into the table right? So it appears that what you want is that only one row in the table should be able to have the value Y in that column. In that case may i suggest that you use a trigger on the form level. If a user changes the value of a check box (this is the event) then you go on and check if the new value is checked and if it is then take approprite steps. Still I dont see why you are doing this, i mena what if a user changes the only checked checkbox to No, what happens then?
Yah !!! you are right. See ,in the entire table ony one record can have the value ' Y ' and rest are ' N ' for the column which is a checkbox item into the form.So that's why for always display chekced item only for one record . if user select one uncheked value then form will set ' Y ' for that column and for rest it will set ' N '.
Any way , I have solved the problem....
you can see the code :
Trigger : When-CheckeBox_Changed
if : supply.primary_ind = 'Y' then
l_record := :system.cursor_record;
if :system.cursor_record <> l_record then
: supply.primary_ind := 'N';
if :system.last_record = 'TRUE' then