Home » Developer & Programmer » Forms » FRM-40102 record must be entered --- error
FRM-40102 record must be entered --- error [message #160814] Tue, 28 February 2006 08:08 Go to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
I write a cursor in button trigger "when button press: :-

declare
CURSOR post_wo
IS
select pp_dpkd.c_code,pp_dpkd.kgs
from pp_dpkd
where ppno=:ppno;

mc_code pp_dpkd.c_code%type;
mkgs pp_dpkd.kgs%type;

begin
open post_wo;
loop
fetch post_wo into
mc_code,mkgs;
exit when post_wo%notfound;

go_block('wosub');
create_record;

end loop;
close post_wo;
end;

when I run form and click on button shows the msg:-
FRM-40102 Record must be entered or deleted first.
Re: FRM-40102 record must be entered --- error [message #160832 is a reply to message #160814] Tue, 28 February 2006 09:52 Go to previous messageGo to next message
siddig
Messages: 3
Registered: February 2006
Location: ryadh
Junior Member
HI,
YOU DID NOT EXCPLAIN WHAT YOU WANT TO DO WITH YOUR CURSOR ANY WAY.
CREATE_RECORD,MAKE THE FORM BUILDER NAVIGATE TO A NEW RECORD
AND EXPECTING YOUR ENTRIES.
REGARDS
Re: FRM-40102 record must be entered --- error [message #160889 is a reply to message #160832] Tue, 28 February 2006 22:53 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Here I want to fetch records through loop.
Re: FRM-40102 record must be entered --- error [message #161068 is a reply to message #160889] Wed, 01 March 2006 19:34 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Try the following code.
declare
   CURSOR post_wo IS
      select a.c_code,
             a.kgs
        from pp_dpkd a
       where a.ppno = :blka.ppno;

   mc_code   pp_dpkd.c_code%type;
   mkgs      pp_dpkd.kgs%type;
begin
   open post_wo;

   go_block ('wosub');

   loop
      fetch post_wo
       into mc_code,
            mkgs;

      exit when post_wo%notfound;
      create_record;
      :wosub.mc_code  := mc_code;
      :wosub.mkgs     := mkgs;
   end loop;

   close post_wo;
end;
In the cursor I have used an alias ('a') where I would normally have used a more meaningful alias, but here I want brevity. Also ALWAYS describe an 'item' as ':block.item'. In the cursor 'post_wo ', from where does the item 'ppno' come? I have just keyed 'blka', you will need to change this to use your control block. The main issue is that you should only go to the block 'wosub' once, not even iteration of your loop.

Please give feedback on this suggestion.

David
Re: FRM-40102 record must be entered --- error [message #161069 is a reply to message #161068] Wed, 01 March 2006 19:35 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
By the way, why don't you just base the block 'wosub' on the table 'pp_dpkd'?

David
Re: FRM-40102 record must be entered --- error [message #161088 is a reply to message #161069] Wed, 01 March 2006 23:01 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Thank You So much david Problem solved.

David I am making project can you help me? CAn you write here your msn or yahoo messengar id, so that i could contact you.


Kamran
Re: FRM-40102 record must be entered --- error [message #161089 is a reply to message #161088] Wed, 01 March 2006 23:11 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Kamran,

This site doesn't work that way. You post your requirements and I will respond, but so may other people. If you have a confidential document you would like me to read then let me know via PM (Private Messaging) and I will give you an email address to which you can send it. If it is not confidential then just attach it to a post and those of us who are interested can download it, read it, and offer you suggestions.

David
Previous Topic: Can't instantiate user-defined object in a form
Next Topic: Data Committing problem (No Changes to Save)
Goto Forum:
  


Current Time: Fri Sep 20 05:40:26 CDT 2024