Hiding a field for a user

hi,i would like to know if i can hide a particular field for a end user. SCENARIO 1: For instance a person who feeds data in an Item card should be restricted in entering the price details. SCENARIO 2: If a person who keys in all sales order information should not see the price details which the system automatically calculates.(he should not get the field even from ‘show column’ option.) I am able to apply filters on the table data for specific users but I wanted to know if this kind of security can be given from SQL server option. Thanks.

No, this required programing, just create new forms for those users.

You can try something like this CurrForm.Comment.VISIBLE(USERID = ‘JAMES’); CurrForm.Comment.EDITABLE(USERID = ‘JAMES’); where Comment is the the name of the field. Put it intî OnFormOpen. But using David’s or mine method will not save you from ZOOM menu command done by experience user :slight_smile:

I would not recommend putting (USERID = ‘JAMES’) as this is client specific and generally hard coding things is never good. Hiding indivdual fields can get very messy and often once the client knows you can make these changes they want them all over the system! A different solution though not great would be to use the user setup table and add an extra boolean field ‘Hide Sales Order Price’. You could tick the few users which should see the prices and have a return function to calculate if the current user should see the field or not based upon this new field. This solution isn’t great as it requires more setup and again gets messy when you have several fields being added to perform different operations through the system. There is no great solution to this problem. :frowning:

More ideas. One can use some group policies. Instead of testing USERID=123 one can test some user account properties (user X is member of group Y or user X field Z property is set to YES) But the example would not be so short.

quote:


Originally posted by VNovikov
More ideas. One can use some group policies. Instead of testing USERID=123 one can test some user account properties (user X is member of group Y or user X field Z property is set to YES) But the example would not be so short.


Example (we save a lot of forms with this [8D]): **OnOpenForm** userright:='xxxx'; "i.O._":="RollenPrüfen".Prüfen(userright); IF "i.O._"=FALSE THEN BEGIN ... END ELSE BEGIN CurrForm.MyFieldName.VISIBLE:=TRUE; END; **Function RollenPrüfen** <b>*Prüfen(VAR userright : Code[20]) ok_ : Boolean*</b> "Member of".SETCURRENTKEY("Member of"."User ID","Member of"."Role ID"); ok_:=FALSE; "Member of".SETRANGE("Member of"."User ID",USERID); "Member of".SETRANGE("Member of"."Role ID",userright); IF "Member of".FIND('-') THEN BEGIN ok_:=TRUE; END ELSE BEGIN // MESSAGE(Text001); //Message possible END; bye André

Danke. Good example.

You might want to check out Lanham’s field level security at www.lanhamassoc.com

Maybe MBS can include this as a feature request for any new version? A property on the control with which you can set which user roles can see the control. Our £1500 HR software product does this, so why this is such a big problem for old Navihoo is beyond me… Meint

the better u go for this using code…for craetion of new form always adds up to the licencing which the implementors wonnt like to…:slight_smile:

This funtionality exists in an add on called field level security. see costcontolsoftware.com Field & Control Security is a trigger-based security function. It can be used to enhance the Security Roles and Permissions provided by Navision, or in conjunction with any client-specific roles, permissions, and modifications. Field & Control Security gives security control to individual Navision objects, including tables, forms, buttons on forms, and even specific fields within a form.