jmathew
24th January 2023, 19:00
Hi,
We would like to have a command in Form Field on the form to restrict access only for Super Users. Can anyone who know this please share the command which can be defined in the form field.
mark_h
24th January 2023, 22:20
Are you talking a command button on a form or are you talking entering data on a form field? I mean in a couple of places I had fields that unless you had permissions you could not click a button. On input fields I would use before input and check stuff and set attr.input to false if conditions not met. I could have queried ttaad200 in company 0 to make sure baan user was super user type of account - if not set attr.input to false. I think I might be missing what you are asking.
OmeLuuk
25th January 2023, 00:51
I think I might be missing what you are asking.
I think it is like this:
group.1:
init.group:
if user.type$ <> "S" then
disable.commands("mark.delete")
endif
(Sorry mark, don´t mean to delete you, as a super user.... but I think it should be possible to call mark.delete)
jmathew
25th January 2023, 04:26
I do not want to edit the program as this is standard session and script is not available. I do remember in the form field the is a way to restrict access for only super users. If anyone is aware of the command please do share the same.
RobertP
25th January 2023, 12:44
As OmeLuuk mentioned.
Insert this code user.type$ <> "S" on the form-field's "Input/Ref Expression" Field. Works a charm. See screenshot
mark_h
25th January 2023, 14:54
I think it is like this:[code]
(Sorry mark, don´t mean to delete you, as a super user.... but I think it should be possible to call mark.delete)
No problem. Back when the I managed the DBA's they liked "to kill mark" sessions. Was a running joke about killing my processess. And now after 20 something years I baan I learn user.type$ - never really needed it, but nice to know. :) :)
jmathew
25th January 2023, 15:44
As OmeLuuk mentioned.
Insert this code user.type$ <> "S" on the form-field's "Input/Ref Expression" Field. Works a charm. See screenshot
Hi Robert,
Thanks, this should work as I had done this many years back and wanted to use the same now.
One more help is if in the same field if we have to allow any user access only when value of field is <> "0" then what would be command that can be used? This means that on the session the field would be editable only when value is not equal to zero.
OmeLuuk
25th January 2023, 17:03
(user.type$ <> "S" and [insert.field.name/here] <> 0) or user.type$="S"
OmeLuuk
26th January 2023, 21:10
And now after 20 something years I baan I learn user.type$ - never really needed it, but nice to know. :) :):D:cool::D:cool::D