tan.wang
25th June 2015, 08:54
Hello!

How to calculate total line for array field?
There is a table field that define as array field like below:domain tcqiv1 qrdr(3)
it is shown on the form.
I want to calculate total line for each array qrdr(1), qrdr(2),qrdr(3)
but, qrdr(1) can be calculate only...

mark_h
25th June 2015, 15:27
What table field are you talking about?

manish_patel
25th June 2015, 16:28
Hello!

How to calculate total line for array field?
There is a table field that define as array field like below:domain tcqiv1 qrdr(3)
it is shown on the form.
I want to calculate total line for each array qrdr(1), qrdr(2),qrdr(3)
but, qrdr(1) can be calculate only...

As per programmers Guide:
For array field, the total value is displayed in the first field of the array; subsequent fields in the array cannot be addressed by the function.

bhushanchanda
25th June 2015, 17:00
Hi,

Not sure about your question, but you can try this -

domain tcqiv1 qrdr(3)
domain tcqiv1 total

qrdr(1) = 100
qrdr(2) = 200
qrdr(3) = 300

total = qrdr(1) + qrdr(2) + qrdr(3)

Unless the array value is not 0, you can always access it.

tan.wang
26th June 2015, 03:33
As per programmers Guide:
For array field, the total value is displayed in the first field of the array; subsequent fields in the array cannot be addressed by the function.

As you said...
Do you know is there any other way to calculate total line for subsequent fields in the array?

tan.wang
26th June 2015, 03:48
Thank you mark_h and bhushanchanda!
In main table, there is a field define as array fields qrdr(3).
and each subsequent fields is shown as view field on the form.
My requirement is calculate the total line for each subsequent fields.

For example:
This is a form
qrdr(1) qrdr(2) qrdr(3)
record1 9 10 1
record2 6 11 3
record3 7 12 4
---------------------------------
total line 22 33 8

manish_patel
26th June 2015, 10:45
I am familiar with display.total.fields() function only. I don't know any other workaround to displays total values for specified fields in the grid.
However in Baan 4 we use to display it in view area.

A new tools function sum.records.in.view() is available from FP7 onward to calculate the value of the total field. Not sure whether it support subsequent fields in the array or not.

----------------
function void sum.records.in.view(const string column1.var, double result1.var [..., ...])

Affected Release
LN FP7

Tools Version:
7.6_a7, 7.6_a8

tan.wang
29th June 2015, 05:27
I am familiar with display.total.fields() function only. I don't know any other workaround to displays total values for specified fields in the grid.
However in Baan 4 we use to display it in view area.

A new tools function sum.records.in.view() is available from FP7 onward to calculate the value of the total field. Not sure whether it support subsequent fields in the array or not.

----------------
function void sum.records.in.view(const string column1.var, double result1.var [..., ...])

Affected Release
LN FP7

Tools Version:
7.6_a7, 7.6_a8

Thanks for your answer.
I try to use sum.records.in.view().
sum.records.in.view() sum the value of total field only, and also support subsequent fields in the array.
but, total line of subsequent fields still can not be shown....