jcook331
1st September 2004, 21:14
I am trying to add a button to a form that will mark all occurences on a form and then perform an action on each. I have been unable to find a way to mark all occurences on the form automatically. Does anyone know of a way to do this?

thanks

lbencic
1st September 2004, 21:28
Take a look through the Wiki topic Form and form field operations synopsis (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_synopsis) to see the available commands.

Not sure what you are trying to call, but you may try the function:

do.all.occ(function name)

to perform a function on all occurances - this does not mark them just perform the action. Read the help on that, in certain sections it only acts on updated rows, but on a button it should do all.

If you need them marked, you can use the mark.occ(occurance #) in combination with the Predefined Variable fattr.occurnr (http://www.baanboard.com/programmers_manual_baanerp_help_misc_predefined_variables) (number of occurances on the form) in a for next loop to mark all the occurances. Something like:


long i

for i = 1 to fattr.occurnr
mark.occ(i)
endfor


Good luck - post back if that does not answer.

jcook331
1st September 2004, 21:31
Thanks, that's just what I needed.

lbencic
1st September 2004, 21:35
actually filled.occ may be better than fattr.occurnr - filled.occ is only the occurances that have data in it.

maverick4u
2nd September 2004, 09:34
filled.occ will mark the filled occurences on the form whereas fattr.occurnr
works on all the occurences on the form. So i guess filled filled.occ is a better
option

long i

for i = 1 to filled.occ
mark.occ(i)
endfor