mraja71
19th September 2002, 18:49
How to write field events in the Program script for
an array element in the form(It is table field).
It is defined as repeating field in the Table
It is type 1 Session.

I like to execute some actions after input of A(1,1) and
different action on after input of A(1,2).

Your help will be appreciated on this.

NPRao
19th September 2002, 20:35
You have to use the predefined variable -

long attr.element 4
Current array index (if field is an array element).

But the field section coding is still the same -


field.xxxx:
check.input
if attr.element = 1 then
do.something()
else
do.nothing()
endif

mraja71
19th September 2002, 21:10
Thanks for the Hint. It solved my issue

When I do the data entry on the screen, I get the last value
entered on the array element is displayed on the other
elements.

for exapmle A(1,10) = "Jam" then A(1,1) to A1(1,10) shows the
same value in the display. After Saving the record In the table I see only A(1,1) = "Jam" and others empty

NPRao
19th September 2002, 22:01
Well, it doesnt happen for me maybe because those are form fields and for you its table fields.

Maybe you can try to use -


| To set a string array to spaces
string string_array(20, 5, 5)
long ret
ret = set.mem( string_array, "" )


And also, refer to the BaaN knowledgebase cases/solutions at the support site -


Standard program behaviour related to defaults.
Author G Wal Creation Date: 20 Nov 2000 Alternate ID:
Solution No: 108130 Last Modified: 08 Feb 2001 Status: Published
Product: ttB40c4 Sub Product: Session: standard program
Package: tt Version: B40 Release: c4
Solution Type: KR:Question

SITUATION IDENTIFIED IN: standard program

SITUATION DESCRIPTION:
What is the standard program behaviour related to defaults?

SOLUTION DESCRIPTION:
This solution describes the way how the standard program will handle the defaults for fields during insert.

The defaulting differs for single and multi occurence sessions. And also differs for mandatory and non mandatory fields.