O'Reilly logo

Microsoft Dynamics NAV 7 Programming Cookbook by Rakesh Raul

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Field-level security

Field-level security does not exist out of the box in NAV and is not easy to implement. In fact, a real field-level security is impossible to implement. This recipe will show you an example of how to quickly create a work around this type of security model in your system.

How to do it...

  1. Create a new table from Object Designer of the name Field Level Security.
  2. Then add the following fields:

    Name

    Type

    Length

    Table No.

    Integer

     

    Field No.

    Integer

     

    Applied To

    Code

    50

    Editable

    Boolean

     

    Visible

    Boolean

     
  3. Set the following properties for these fields:

    Field name

    Property

    Value

    Table No.

    TableRelation

    Object.ID WHERE (Type=CONST(Table))

    Field No.

    TableRelation

    Field.No. WHERE (TableNo=FIELD(Table ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required