en@frrom
30th May 2005, 14:13
Hello all,

I have an array field which I need to display on a form in a display session. The field is an address field filled with up to 6 elements, formatted using the tccom.dll4030.format.address() function.

I tried displaying using function display("address"), which gives me only the first element of the array. How do I get all elements displayed?

Thanks in advance,

En.

beginer
30th May 2005, 15:15
Hi ,

At my place we are assigning the array elements into seperate variables like add1 , add2 , add3 .... & then using the display() function for every variable dispay on form.

regards,

en@frrom
30th May 2005, 15:26
Hello beginner,

Of course that is a workaround, but I assume that this must be possible with an array field also...??

lakoon
30th May 2005, 15:48
Hello

..but I assume that this must be possible with an array field also...??

Just had to solve this also with the work around, but I would be happy to know the way with the arrays as well

/lakoon

lakoon
30th May 2005, 16:22
Hello

I just tried


domain tcmcs.str80 progress(8)
long i
for i = 1 to 8
attr.element = i
display("progress")
endfor


.. and it works so far.

/lakoon

en@frrom
30th May 2005, 16:29
Perfect Lakoon! This works.
Thanks for your input!

En

NPRao
31st May 2005, 21:54
Alternatively -

display.all() Displays all fields of all occurrences.

display.fld()
Displays a specified field of a specified occurrence. To display a field for all occurrences, use the following construction:

for i= 1 to filled.occ
display.fld( i, field )
endfor

en@frrom
1st June 2005, 11:30
NP, are you not mixing up array elements with multi occurence display...??

NPRao
1st June 2005, 20:34
En,

I have used display.all() on process sessions. The other function display.fld() is for the multi-occ sessions.

I was suggesting alternative solution to Lakoon's idea.

Ankita
19th March 2008, 08:26
Hi,

I have to display array field in a display session. The field is not in the table. The code written in above post for progress field doesnt work in my case. I am firing query for fetching all the bills for each item from the table (bills) other than the main table (items) in after.read event of main.table.io section of the script. My session is on the master table i.e. Items. I have to display all the bills for each item.

Please, can anyone suggest me how to display all the bills for each item in this situation. Or somebody has any other solution?

Thanks.

en@frrom
19th March 2008, 10:00
Hello Ankita,

I think if you post your code, it will be easier to understand and analyse your problem, abnd thus try to help you with a solution...


Regards,
Eli Nager

Ankita
19th March 2008, 10:30
Thank you Eli for the reply.

Following is the code,

declaration:

extern domain tcyesno process.status
extern domain tcmcs.st12 billno(10)

before.program:
query.extension = "lhitm002.suno <> '' and lhitm002.itmn in (select itmn from lhitm003 where prdt = 0)"

main.table.io:
after.read:
long i

select blno:billno
from lhitm003
where lhitm003.itmn = :lhitm002.itmn
selectdo
attr.element = i
display("billno")
i=i+1
endselect

Tables: lhitm002 (items) Indices: 1. itmn 2. suno + itmn
lhitm003 (bills) Indices: 1. itmn + blno

itmn is item no, suno is vendor code and blno is the bill no.

I have created display session on the items table to display items vendor code wise. Now, i want to display all the bills for each item. Hope, this code will make my problem more clear.

Thanks.

en@frrom
19th March 2008, 10:40
What form type is it? Maybe you can include a printscreen of your form as well?

Ankita
19th March 2008, 11:22
Hello,

Thank you for the quick reply. Form type is 3.

As you can see in the form, only one bill is shown for one item no. But there are 3 bills in the table. It is showing the last bill no. for that item.

Thanks.

csecgn
20th March 2008, 00:20
If I see correctly lhitm002 is your maintable. This will not work because lhitm002 has only one record for each item (or maybe more if you have more suppieres). The count of records in a form is controlled by the count of records in the maintable. You cannot extend this by your own fields (ok, you can. But in this case your form is not controlled by your maintable and not a type 3 form).
Make lhitm003 maintable in your form an filter (or set the group) by the item from lhitm002.

hth

Regards
Christof

Ankita
20th March 2008, 05:26
Thank you for the reply. If i generate my session taking bills table as my main table then i cant show my items vendor code wise, which is in the master table. So, can you suggest me some way to show all the bills of each item vendor code wise.

csecgn
20th March 2008, 09:35
For the session the table with the most records allways needs to be the master/main table. You need a m : 1 relation to read the additional tables/data. Without this it will not work in Baan.

In my opinion you have three possibilities:


Create a reference between lhitm003 and lhitm002 (from lhitm003 to lhitm002 on field itmn) on table level

maintable io:


main.table.io:
after.read:

select lhitm002.*
from lhitm002
where lhitm002.itmn = :lhitm003.itmn
selectdo
endselect


query extension

form.1:
init.form:
query.extension = "lhitm003.itmn refers to lhitm002"

I'm not sure about the correct section for the query extension. But in in the in the form the section it works (currently no Baan available. I don't use it very often. Mostly I have/create a reference between the tables for this). before program should work also.


With one of this you can put the needed fields from lhitm002 directly on the form. I think maintable io is the easiest way.

hth

Regards
Christof