Home » Developer & Programmer » Forms » master details (forms 6i)
master details [message #512323] Sun, 19 June 2011 02:36 Go to next message
omernas
Messages: 3
Registered: June 2011
Location: sudan
Junior Member
i'm doing a inventory system from a book.. in the master details forms the number of columns is more than the number of columns in the table. how is that?
in the maintenance form, the maint table is the master which have 4 columns maintcode,manitname,desc and recvdate. and the maintsitem table is the detail which have 4 coulmns maintcode,itemcode,amount and numbertes.
in the form the master block which is form type, have 4 texts, and the detail block which is tabular type have 8 texts there are extra columns quantity,item model,maintenance, and total, where did these columns come from? are they added manually? if yes how i'm going to deal with them..
thank you in advance..
Re: master details [message #512347 is a reply to message #512323] Sun, 19 June 2011 09:19 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is difficult to guess. You said you used "a book". Which one? I most probably don't have it, but someone might; you should have provided some more details.

It is a common practice to create a block that contains more items that number of columns in a table. For example: there's the ITEMCODE column in a table. If you created a form that displays just that column, and knowing that a "code" can look quite unreadable (such as "12887563" or "AX9982-33" or similar), people create additional (display) item (ITEM_NAME) which is NOT contained in that table, but in another one. You then fill its value using different triggers (such as POST-QUERY while querying existing data or WHEN-VALIDATE-ITEM when inserting new information).

I don't know how these additional items were created, but you might find that out by checking their properties, as well as detail block's properties. Block is most probably created in the "detail" table, but - maybe it is not. Maybe its data source is a view (or something different, such as a procedure or a FROM clause). Items' properties will discover whether these items belong to a table or not.

Anyway: you should do some investigation. If you have additional questions, feel free to ask. I hope someone will be able to assist.
Re: master details [message #512395 is a reply to message #512347] Mon, 20 June 2011 02:00 Go to previous messageGo to next message
omernas
Messages: 3
Registered: June 2011
Location: sudan
Junior Member
thanx for these information..
from what u said.. can i add additional items to the detail form from other tables in the database apart from from (the master detail 2 tables)?
because the additional items i found them in other tables in the dbs such as items table and itemsdetail tabls..
so i can add these items from these tables and fill them by using certain triggers?
Re: master details [message #512417 is a reply to message #512395] Mon, 20 June 2011 04:32 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can add items for them. You would set the database_item property of these items to No.
You'd then populate them in the post-query trigger and the approprite when-validate-item trigger.
So if you've got an itemcode in the block and want to display the itemname, you would add a non-database item for itemname and
write a select statement to populate it in the when-validate-item trigger on itemcode.
You would put the same select in the post-query trigger so that it's populated when you query records.
Previous Topic: FRM-40501 then ORA-24374
Next Topic: function not working
Goto Forum:
  


Current Time: Sat Sep 07 16:06:29 CDT 2024