how to protect selecting same row from the LOV.......... [message #132758] |
Tue, 16 August 2005 01:02 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
imtiazmasud
Messages: 49 Registered: May 2005 Location: Bangladesh
|
Member |
![241](/forum/theme/orafaq/images/icq.png) ![imtiazdiu%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
Hi everyone,
I am facing a problem with my Lov that,Suppose I have a LOV
1. Rice
2. Potato
3. Jute
4. Sugar etc..
Now Suppose I am a shopkeeper.I have to make a bill for my customer.I have a product list LOV(Containing my product list).I have to select some goods from lov into a block and will have to put some corresponding value to each item and then save and make a bill.
Now The problem is that Suppose I have select Rice from lov and put corresponding price. If want to select the item Rice twice or thrice or more times for the same bill then it will send a message that " You Have selected rice one time and you can not select it twice for the same bill"...the core fact is that I just want that I can choose several items but will be able to select one item onetime for a bill from LOV....
So please... I will be very helpful if someone replies..if any problem to understand problem then ask I will try to make it more clear in another way..........
[Updated on: Tue, 16 August 2005 01:15] Report message to a moderator
|
|
|
|
|
Re: how to protect selecting same row from the LOV.......... [message #137161 is a reply to message #132765] |
Tue, 13 September 2005 08:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Shahzad_Khan
Messages: 8 Registered: September 2005 Location: Karachi
|
Junior Member |
![oraware%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
Hi Allz
Dear Imtiaz here is code try it
1. Create data block (EMP) with item (DEPT_ID).
2. Add command button CMD_DEPT near item (DEPT_ID).
3. Create TWO record groups (RGR_DEPT_FULL and RGR_DEPT_PART)
Both groups have the same SQL-statement
select DEPT_ID,DEPT_NAME from dept
4. Populate these record groups in Pre-Form trigger
declare
Num NUMBER:=0;
begin
Num:=populate_group('RGR_DEPT_FULL') ;
Num:=populate_group('RGR_DEPT_PART') ;
end;
5. Create LOV (LOV_DEPT) based on first record group (RGR_DEPT_FULL)
6. Set column Mapping Properties for this LOV.
7. Set LOV's Property "Automatic refersh" to NO
8. Set item's property "List of Values" to 'LOV_DEPT'.
9. Add WHEN-BUTTON-PRESSED trigger for command button (CMD_DEPT)
declare
rec_count number;
lAsk BOOLEAN :=FALSE;
begin
-- Change LOV's record group
set_lov_property('LOV_DEPT',GROUP_NAME,'RGR_DEPT_PART');
-- Call LOV
lAsk:=show_lov('LOV_DEPT');
-- Come back LOV's record group
set_lov_property('LOV_DEPT',GROUP_NAME,'RGR_DEPT_FULL');
-- if value selected then removed it from second record group
if lAsk then
rec_count:=get_group_row_count('RGR_DEPT_PART');
for j in 1..rec_count loop
if get_group_char_cell('RGR_DEPT_PART.DEPT_ID',j) = :EMP.DEPT_ID then
delete_group_row('RGR_DEPT_PART',j);
exit;
end if;
end loop;
end if;
end;
Thsi solution has one problem.
When your call LOV directly from item (DEPT_ID) by pressing F9 function key you will see full list of department. But when you press command button (CMD_DEPT) you will see only not selected list.
Good Luck.
Khurram Siddiqui
khurrampc@hotmail.com
oraware@yahoo.com
[Updated on: Tue, 13 September 2005 18:59] by Moderator Report message to a moderator
|
|
|