en@frrom
10th March 2008, 16:27
For a maintain session with form type 3 (multi-occ + main + view) I want to be able to set the entire form to display/readonly, when status = X. I.e. all fields shall be disabled, all commands like add.set, mark.delete, global.delete, start.set etc.
Does anyone know of a way to achieve this easily, rather than having to specify each field and command? In other words, is there a command/function/parameter which allows setting a form/session mode to display/maintain?
Thanks in advance!
Regards,
Eli Nager
NPRao
10th March 2008, 18:50
For a maintain session with form type 3 (multi-occ + main + view) I want to be able to set the entire form to display/readonly, when status = X. I.e. all fields shall be disabled, all commands like add.set, mark.delete, global.delete, start.set etc.
Eli,
If you need to disable ALL the fields on a session to a readonly mode based on some condition, you can do so by disabling group 1, which is a superset group which contains all groups (group 1 is restricted). You don't need to disable fields (or groups) one by one. If you are doing this in overview mode, make sure to enable the group again if you expect scrolling etc. This is typically called in section "before.display.object". This is applicable only for DFE.
disable.group(1, READONLY) or disable.group(1, READONLY, actual.occ)
before.display.object:
enable.disable.fields.based.on.status()
|******************************************************************************
choice.mark.occur:
after.choice:
enable.disable.fields.based.on.status()
|******************************************************************************
function enable.disable.fields.based.on.status()
{
select zmmig200.*
from zmmig200
where zmmig200.reqid = :zmmig201.reqid
selectdo
set.vrc()
bret = tt.user(zmmig200.sblg, developer)
endselect
if zmmig200.stat > zmmig.stat.submitted then
disable.group(1, READONLY)
disable.commands(add.set, mark.delete, modify.set, global.delete)
else
enable.fields("zmmig201.cmptype", actual.occ,
"zmmig201.fcpn", actual.occ, "zmmig201.adby", actual.occ,
"zmmig201.newcomp", actual.occ, "zmmig201.emig", actual.occ)
enable.commands(add.set, mark.delete, modify.set, global.delete)
endif
}
|******************************************************************************
Alternatively,
domain zmadm.str30 fldname |* Field name
field.all:
before.display:
if synchronized.reason > 0 and
zmmig200.stat >= zmmig.stat.migrated.to.pro then
fldname = fattr.currfld$
disable.fields(fldname)
endif