Generating a table in Notes form based on the number of item

I have a Notes database that stores the repair Work Orders. What I would like to do is creating a separate database to store the repair detail with more information and picture of the item that is damaged.

My problem is in one Work Order, there are more than 1 item listed. Usually I just create a button that will create a form on a different database and pass some data. But, in this case, I want each item to have its own separate table in one form. So my question would be how do I create a form that will generate a table (that will host some number of fields) depending on the number of items.
Who is Participating?
Sjef BosmanConnect With a Mentor Groupware ConsultantCommented:
The short answer is: you can't, and that's something you should have thought of before you started the development.

Two ways to design this: the usual way, and the advanced way.

The usual way would be to define item forms and to create item documents. Each item contains the key of the parent document, either a logical one or a physical one (as in a parent-response relation). You can use an embedded view and a category to display the per WO items.

The advanced way is to combine the WO and item documents into one. Make one WO, and create multi-value item-fields. All item-fields with the same index are together one "record", e.g. itemname[4] and itemdate[4] are both elements of the 4th item.

What you can do, with your current design: create a computed text field that you fill with text related to the items. You'd have to do all the lookups, fetch the data, format the text, etc.etc.etc.
Sjef BosmanGroupware ConsultantCommented:
Don't understand... Why do you want to generate a table when every related document will contain data for only one item? What is the structure of the original form, and what should the related form look like?

Maybe you can add some picture or drawing of what you exactly want?
if you already have a button to create a new form with detail damaged item.
you can do the same with the formula language and a @for loop

@for(i:=1 ; @elements(myitemslist) ; i:=i +1 ;

coronoahcoroAuthor Commented:
- each WO record has a string field. This field contain item numbers that are separated by a space. If there is no item number '.' (a period) is added to the string.
- I need to create a form that will display all item numbers with their additional details when a user click a button from the WO record. The additional item details reside on a different database.

So my question is I don't know how to design a form that will display each item number and its details.
Sjef BosmanGroupware ConsultantCommented:
This link might be helpful if you try solution #2:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.