en@frrom
6th August 2010, 15:11
I have an input session with main table, the main table contains an array of 10 for 1 field. Based on data defined in a different table, I will assign labels/names to the various elements of the array field.

Example:
- main table ttmmm001
- index: item
- 2nd field: arr(10)

- table ttmmm002
- index: sequ(ence)
- 2nd field: desc(ription)

In the main input session, I want to show the field ttmmm002.desc as a label for each one of the array elements. Thus I have a form field desc(10) in which I assign all the values from ttmmm002, where sequence is the element number. I put this field's elements as a header. So instead of using labels, I use string fields which contain the label text.

This works fine once the main session contains records (items). However, before inserting records for the first time (i.e. table is empty thus no records displayed), the label fields will not be shown. Through debugging I see that the values do get filled into the label fields, yet still nothing gets displayed.

It seems like the system will not show ANY FIELDS if no records are found in the main table (i.e. no occurences filled).

My question:
1) does anyone know how Baan checks it and deals with it?
2) Does anyone know a way around? I thought of either somehow fooling the system and make it seem there ARE records found, or displaying the variable label fields in a different way.

Note: this is not a dynamic form, so no dynamic form options are relevant.


Thanks a lot in advance,
Eli Nager

SujithKumar
6th August 2010, 18:56
In which section are you assigning the label names?

en@frrom
6th August 2010, 19:00
Tried in all kind of sections: before/init.form, main.table.io before/after.read, before/after choice find.data, before.field sections, etc.

The conclusion is the fields do get their value assigned - that is not the problem (varified in debug mode) - the issue is that Baan "refuses" to show their value. Probably because it decides no fields whatsoever shall be displayed if no records in main table exists (= no records to display in multi-occ form rows). Also various display() calls at various points in the program did not bring results.

sameer.don
7th August 2010, 11:51
You can set "insert" as a start command, or can execute "add.set" in before program if table was empty. This will display the fields according to field order.
So, if u set field order of label/display field prior to all other input fields, u ll be able to see these fields as label.
But fileds may disappear if user clicks undo. Thus it would be more preferred to use array of form fields instead array of table fields.

en@frrom
9th August 2010, 13:13
All these things won't help. The problem is not that the insert command is not triggered. The problem rather is, that the label fields are never displayed as long as no records exist in the main table. They are btw array form fields.

wiggum
30th August 2010, 16:50
Define a dummy label in the form for your fields of table ttmmm001 (or use label of table definition). In the after.form.read section read the labels from table ttmmm002 and set the label to your fields by calling function change.field.label(<form field>, <array element>, <new label>) for each array element (record of ttmmm002).

Hitesh Shah
30th August 2010, 18:19
U may try to display all field (funtion) in after choice of all data browsing/refresh choices if filled.occ = 0 . Probably it may work .