Home » Developer & Programmer » Forms » Creating a Record (Oracle IDS 10g,Windows XP)
Creating a Record [message #403383] Fri, 15 May 2009 04:46 Go to next message
anugraha
Messages: 15
Registered: February 2009
Junior Member
Hi All !

I have created form based on a table ..

In that for say 4 fields alone i want a record to get created when click a button with the coding
create_record;


But this is not happening ..

So when i tried with two datablocks based on same table in a canvas, then the records getting saved as different rows..

All i want is the fields entered in the form must be stored as single record( the new records created for certain fields in the second datablock and the records in the first datablock)..

pls help to achieve this !

Thanks and Regards
anu
Re: Creating a Record [message #403384 is a reply to message #403383] Fri, 15 May 2009 04:54 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It won't work; not the way you've described, that is. 2 data block mean 2 different records -> COMMIT will save both records, not only one (that is supposed to be a combination of items that belong to the first and items that belong to the second data block).

It means that you'll have to change the logic.

What problem are you, actually, trying to solve? Why 2 data blocks?

CREATE_RECORD does create a new record; why did you say that it didn't happen? Was there any error message? If so, which one?
Re: Creating a Record [message #403386 is a reply to message #403383] Fri, 15 May 2009 04:59 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
I don't understand your problem but create_record will create a new record in the current Block. So the button must be Non-navigable. Or make a Go_block in the when-button-pressed.
Re: Creating a Record [message #403387 is a reply to message #403384] Fri, 15 May 2009 04:59 Go to previous messageGo to next message
anugraha
Messages: 15
Registered: February 2009
Junior Member
Hi !

What i try to achieve is this..

I have created a form with 25 fields ..

Now, in this for particularly around 4 fields alone, the user has to give multiple input ..

When i place a button in my form for create_record, it clears my entire form and gives a new record to enter..

But i need new record to enter for those 4 fields alone..

How am i to achieve this?

Or is there any other solution?

Thanks and Regards
anu

[Updated on: Fri, 15 May 2009 05:17]

Report message to a moderator

Re: Creating a Record [message #403389 is a reply to message #403387] Fri, 15 May 2009 05:20 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Does it mean that you'd like to create a master-detail form? Furthermore, does it mean that those "multiple inputs" are details of the master record (represented by the rest of the items)?

If so, perhaps your data model is sub-optimal. Is this table normalized? I don't think so (according to your description) - perhaps you should think of separating those 4 items into a new table (don't forget to include a "connecting" column - it should be used to enforce referential integrity constraint).

Once this job is done, form creation will be quite easy.
Re: Creating a Record [message #403391 is a reply to message #403389] Fri, 15 May 2009 05:33 Go to previous messageGo to next message
anugraha
Messages: 15
Registered: February 2009
Junior Member
yes, i already tried by creating a separate table for those fields..

For example consider:
I have 2 tables. book and book1

Book table has the fields:

Bookid, Bookname
Book1 table has the fields: Bookid, Author


Now for this book1 table, i have placed a button for creating new record, for making multiple entries for author provided the bookid of book and book1 are same ..

when i save after filling these fields, it gets saved in its corresponding table ..

But when it comes to retrieve, iam able to retrieve record in book table and one record for book1( But more one entry has been made for the author field for the same bookid using create_record)..

How can i view all the authors of particular bookid ?

when i click next_record, it gives the message
Do you want to save changes made?


pl help .,

Thanks and Regards
anu
Re: Creating a Record [message #403394 is a reply to message #403391] Fri, 15 May 2009 05:52 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
OK, we have agreed that 2 tables should be used. I'd suggest you to do that now.

Delete (i.e. abandon any work on) an existing form.

Create a new form from scratch. Use data block wizard. As "author" can be an "author of more than one book", I presume that "author" should be master and his/her "books" detail block. If you have correctly set that up during tables' creation process, Forms Wizard will know about it and automatically correctly set relationship between those blocks.

You may choose how many records to see in each of these two blocks (for example, 1 record for authors and 10 records for books).

Forms default behaviour is such that you don't have to code ANYTHING to make it properly work. NOTHING at all! No "create record" buttons - just use its built-in functionalities.

Once you make the form work, make it fancy (if you wish).
Previous Topic: hierarchical tree Problem
Next Topic: How Can I attach the d2kwutil.pll to the form and Win_Api_Shell.SendKeys must be declared (merged)
Goto Forum:
  


Current Time: Sun Dec 11 02:29:32 CST 2016

Total time taken to generate the page: 0.07894 seconds