O'Reilly logo

Microsoft Dynamics NAV 2009 Programming Cookbook by Matt Traxinger

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

Assigning menu suites based on company

Unfortunately, NAV only supports assigning one menu suite to a user. This recipe will show you how to set a user's menu suite at runtime based on the current company.

How to do it...

  1. Design the User Menu Level table (2000000061).
  2. Save the table as User Menu Level by Company with a new object ID.
  3. Add the following field to the table:

    Name

    Type

    Length

    Company

    Text

    30

  4. Set the following properties for the field:

    Field Name

    Property Name

    Value

    Company

    TableRelation

    Company

    Company

    NotBlank

    Yes

  5. Add the Company field as the first field under Primary Key.
  6. Save and close the table.
  7. Create a new codeunit from Object Designer.
  8. Add a global function named LoadMenusuite.
  9. Add the following local variables ...

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