a.menon
6th October 2013, 08:18
I have a form in which there are N number of fields and corresponding N check boxes. I need to hide a checkbox corresponding to a form field if the value in the form field is " " . For eg

if isspace (x004) then
inputfield.invisible("y004")
endif

where x is the prefix for the form fields ranging from 0 to n. And y is the prefix for the checkboxes.

Is there a way to loop through each form field (x) to do this check ?

bhushanchanda
6th October 2013, 11:13
Hi,

I am not sure if its possible, because for what you are looking for, you will need variables which will act as field names. But, program wont understand that its a form field or a variable. Again, I am not sure, there may be some undocumented function to convert a variable to a form field.

Theoretically it looks possible by taking all the fields in an array and then manipulating it using a while/for loop and some pattern matching, but technically I guess its not possible.

andreas.toepper
7th October 2013, 09:30
I did use array-formfields in LN FP6/FP8 and looped through those array-fields by creating the strings containing the fieldnames on runtime:

extern domain tcpono pono(20)

for i = 2 to 20
if pono(i-1) = 0 then
disable.fields("pono("&str$(i)&")")
endif
endfor

But I don't know, whether this will work in ERP5 or not. An fieldcheck like isspace() won't work using this way - I think. That's why I used arrays.
There's expr.compile() also, which could be used to calculate expressions on runtime, but I never used that before. (I just prefered using arrays for field-loops.)

vamsi_gujjula
7th October 2013, 11:29
i have never tried it , but have look at Runtime expressions
s.expr$()

a.menon
7th October 2013, 16:08
I did use array-formfields in LN FP6/FP8 and looped through those array-fields by creating the strings containing the fieldnames on runtime:

extern domain tcpono pono(20)

for i = 2 to 20
if pono(i-1) = 0 then
disable.fields("pono("&str$(i)&")")
endif
endfor

But I don't know, whether this will work in ERP5 or not. An fieldcheck like isspace() won't work using this way - I think. That's why I used arrays.
There's expr.compile() also, which could be used to calculate expressions on runtime, but I never used that before. (I just prefered using arrays for field-loops.)

Hi,
I tried the same with array form fields in BAAN 5 . It works like a charm!
Thanks a lot! ..