Page 1 of 1

UserLevel greater than hide field

Posted: Wed Dec 21, 2022 6:00 am
by crash

I'm trying to hide a field when user level is greater than a certain value

if (CurrentUserLevel() > "4") <fieldname>.Visible = false;

I get this error
Operator '>' cannot be applied to operands of type 'string' and 'string'

My field is an ineteger

It works fine when I use
if (CurrentUserLevel() == "4") <fieldname.Visible = false; but then it's a fixed nunmber


Re: UserLevel greater than hide field

Posted: Wed Dec 21, 2022 11:00 am
by MichaelG

You can convert the value to integer first. For example:

if (ConvertToInt(CurrentUserLevel()) > 4)