Home » Developer & Programmer » Forms » Detail block display only first record (forms6i)
Detail block display only first record [message #306896] Mon, 17 March 2008 03:35 Go to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
I have form which includes Master-Detail block(Item=master,Item's components=Detail)
User can find Item by click 'Find' Button and choose one of them from LOV.

What should I do if i want to show every record in Detail block
it always display only first record returned.



coding in when-button-pressed is


go_item('MTL_ITEMS.INVENTORY_ITEM_ID');
list_values;

declare
cursor c1 is
select bcv.line_number,
bcv.fab_code,
bcv.fab_desc,
bcv.status
from bpc_fab_data bcv
where bcv.item_id = :MTL_ITEMS.INVENTORY_ITEM_ID
order by bcv.item_id;

v_line_number number;
v_fab_code varchar2(20);
v_fab_desc varchar2(200);
v_status varchar2(1);

BEGIN
OPEN c1;
LOOP
FETCH c1 INTO v_line_number,v_fab_code,v_fab_desc,v_status;
EXIT WHEN c1%NOTFOUND;
:BPC_FAB_DATA.line_number := v_line_number;
:BPC_FAB_DATA.fab_code := v_fab_code;
:BPC_FAB_DATA.fab_desc := v_fab_desc;
:BPC_FAB_DATA.status := v_status;
END LOOP;
CLOSE c1;
END;

refer to http://forums.oracle.com/forums/thread.jspa?threadID=622460&tstart=0&messageID=2366947

I've tried this one but it still display only first record


Please help me, Thank you so much.
Re: Detail block display only first record [message #306905 is a reply to message #306896] Mon, 17 March 2008 04:01 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Use the WHERE CLAUSE of the master block
Re: Detail block display only first record [message #306926 is a reply to message #306896] Mon, 17 March 2008 05:26 Go to previous messageGo to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
I've tried to use WHERE CLAUSE of the master block but it still display only first record.

anyway thank you so much.


more information :

If I use F8 for query, it will display for all record(that's correctly).
Re: Detail block display only first record [message #307047 is a reply to message #306926] Mon, 17 March 2008 13:10 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's no NEXT_RECORD in the loop, so every new line overwrites previous one.
Re: Detail block display only first record [message #307123 is a reply to message #306896] Mon, 17 March 2008 21:06 Go to previous messageGo to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
If there's NEXT_RECORD in the loop, SECOND record will display and then
error message : FRM-41106 You cannot create records without parent record and the second error message is FRM-40102: Record must be entered or deleted first.

Littlefoot thank you so much.


I'm very newbie for programmer and not so good in English but please help me.

[Updated on: Mon, 17 March 2008 21:23]

Report message to a moderator

Re: Detail block display only first record [message #307232 is a reply to message #307123] Tue, 18 March 2008 03:48 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I think that the best move you can do is to delete the current form and start working on a new one from scratch.

Code you've written should be avoided; use Forms Data block Wizard and let Forms do all the job (really ALL of it! - don't write a single line of code yourself!).

Doing so, you'll make sure that the basic master-detail functionality will work flawlessly. Once you make it work, save the form and try to make it fancy (if there's a need to do that).
Re: Detail block display only first record [message #307285 is a reply to message #306896] Tue, 18 March 2008 05:53 Go to previous messageGo to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
I've change my coding to


declare
cursor c1 is
select bcv.line_number,
bcv.fab_code,
bcv.fab_desc,
bcv.status
from bpc_fab_data bcv
where bcv.item_id = :MTL_ITEMS.INVENTORY_ITEM_ID
order by bcv.line_number;



BEGIN
OPEN c1;
GO_BLOCK('BPC_FAB_DATA');
FIRST_RECORD;
LOOP
FETCH c1 INTO
:BPC_FAB_DATA.line_number ,
:BPC_FAB_DATA.fab_code ,
:BPC_FAB_DATA.fab_desc ,
:BPC_FAB_DATA.status ;
EXIT WHEN c1%NOTFOUND;
NEXT_RECORD;
END LOOP;
CLOSE c1;
END;


this coding will display all records


Thank you so much to Littlefoot and everybody
Re: Detail block display only first record [message #376418 is a reply to message #306896] Wed, 17 December 2008 04:59 Go to previous messageGo to next message
laith
Messages: 41
Registered: December 2008
Location: U.A.E
Member
I have the same code but non database form, and it shows all record, but it gives me error:
FRM-40201: Record must be entered and deleted first

how i can solve this problem ? thank you
Re: Detail block display only first record [message #376469 is a reply to message #376418] Wed, 17 December 2008 07:58 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perhaps you are navigating to the "second next record" which can not be done unless you
a) fill in the current record
b) delete the current record.
Previous Topic: do_key
Next Topic: Webutil 1.0.6 slower into forms 10g
Goto Forum:
  


Current Time: Sun Feb 09 10:01:50 CST 2025