Page 1 of 1

Re: Hide table field to specific user

Posted: Thu May 03, 2018 10:40 pm
by MatteoAllix

Hello,

is it possible to hide a field from a table to a typology of users only when you enter in the edit page?

My requirement is to remove the ability to add or modify the value of a field to a particular type of user (the administrator can do what he wants).
This particular field must be read only for normal user (i.e. in List Page and in View Page).

Thanks,
Matteo.


Re: Hide table field to specific user

Posted: Fri May 04, 2018 10:43 am
by motfs

Use FieldVisibility extension to hide the field. Read the notes to see how to use it after you click the extension


Re: Hide table field to specific user

Posted: Fri May 04, 2018 5:24 pm
by MatteoAllix

Okay, it works.

but if I want that a field become "HIDDEN" only for a particular type of user?
Because Field Vsibility removes that field from the dataset, I need it to be written, but not visible to the user..

Thanks,
Matteo


Re: Hide table field to specific user

Posted: Sat May 05, 2018 9:26 am
by motfs

but if I want that a field become "HIDDEN" only for a particular type of user?

If the particular type of user is an User ID or an User Level, note that FieldVisibility extension supports User ID/Level also.

Alternativey, you can use Startup Script to hide/show the field with your condition (use jQuery .hide, read http://api.jquery.com/hide/), e.g.:

if (<your condition>) {
$("#x_<Field>").hide(); // Replace <Field> with actual Field Name, if not sure, view HTML source to check the element ID.
}

Read Server Events and Client Scripts -> Client Scripts -> Startup Scripts in help file for more detail.


Re: Hide table field to specific user

Posted: Wed May 16, 2018 3:34 pm
by MatteoAllix

Alternativey, you can use Startup Script to hide/show the field with your condition
(use jQuery .hide, read http://api.jquery.com/hide/), e.g.:

if (<your condition>) {
$("#x_<Field>").hide(); // Replace <Field> with actual Field Name, if not sure,
view HTML source to check the element ID.
}

is it possible to get the user level here?
In C# I have CurrentUserLevel().