RobertP
19th June 2012, 13:56
It used to be fairly easy to disable forms. Very important - by that I mean, disable access to the form (by grey out of it's text, so really, disabling it)
So, what I'm trying to do is enable/disable form 2 (group 2) depending on whether user has selected a record that meets certain requirements. Naturally home base is form 1 (group 1)
How is this possible using DFE?
At the moment I've worked around it in "before.group" of form 2 (group2):
if not blaa.blaa then
to.group(1)
endif
I'd much rather see the form disabled altogther.
Thanks
mark_h
19th June 2012, 15:38
You can look at what is mentioned in this link (http://www.baanboard.com/baanboard/showthread.php?t=22497&highlight=disable+forms). Never done it myself and I think the only time I did something like this I used the to.form command like you did. Of course your using 5 or LN so there might be other commands.
RobertP
20th June 2012, 14:35
Thanks Mark, but the workaround is messy. Takes a second or 2 for the process to finish. I recall it being s easy to disable/enable forms "in the good old days"
Why in your opinion have all these options been removed?
mark_h
20th June 2012, 15:45
I do not know if the options have been removed - I only know the to.form method. I do wonder though if you could disable commands to go to the next form or group. Something like next.frm, prev.frm, etc - disable those until the right conditions are met. Not sure of the disable.commands since it is not in 4c4.
BaanInOhio
27th June 2012, 19:50
Use 'disable.group' to make a form (by group) read only or disabled. Two arguments, first is the group, second (optional) is the mode ("DISABLE" or "READONLY"). You can get the group associated with the form from the DFE. You may have to disable multiple groups if on a single form.
You can also use 'group.invisible' to competely hide the group, including labels, fields, and sub-groups. It has a single argument for the group number. This one isn't as flexible as the 'disable group' since it must be called early in the session (before.program or after.form.read).
You can enable a disabled group by calling 'enable.group'.
RobertP
27th June 2012, 21:33
Thanks BaanInOhio! Worked there once (Cleveland). Great place