How to Disable Tools > Zoom Function in Dynamics NAV

We can quite easily disable ShortCutKeys in Dynamics NAV by creating hidden Menus (with keyboard shortcuts assigned to them). However, how do we disable Tools > Zoom Function in Dynamics NAV? How do we hide sensitive data from SUPER users? Of course, we could encrypt the data, so it would not make sense for a person viewing it, however there must be a way, of disabling Tools > Zoom function for SUPER users. There must be a way…

And, in fact, there is (thank you Peter for sharing this information)! Quite an ugly way (involves a little bit of coding), but it does the trick. Not only, it can disable the Tools > Zoom function, but it can also prevent SUPER user from opening the table directly in Object Designer!

How to Disable Tools > Zoom Function in Dynamics NAV
1. Go to Object Designer, and design Codeunit 1 ApplicationManagement:
Disable Tools Zoom - Design Codeunit 1
Click Tools > Object Designer (or SHIFT+F12). Click on “Codeunit“. Click on Codeunit 1 ApplicationManagement and click Design.

1.1. Create a new function call DisableZoom:
Disable Tools Zoom - Create New Function DisableZoom
Here, if we will use only ERROR(”), this will disable the Tools > Zoom function for all users. However, we could incorporate more meaningful logic behind this function, with which we could allow or restrict specific users from using Tools > Zoom function.

1.2. Modify existing function CaptionClassTranslate:
Disable Tools Zoom - Modify Existing Function CaptionClassTranslate

2. For the form, for which you want to disable Tools > Zoom function, modify underlying table:
2.1. Find which table needs to be modified:
Disable Tools Zoom - Form Properties - SourceTable
Open form, click Tools > Designer (or CTRL + F2), click View > Properties (or SHIFT+F4), find SourceTable property.

2.2. Design table in Object Designer:
Disable Tools Zoom - Design Table

2.3. Add new field of Text type (I have called it “Disable Tools > Zoom”):
Disable Tools Zoom - Create New Field Disable Tools Zoom

2.4. Define CaptionClass as ‘9999,5050’ (click View > Properties (or SHIFT+F4) and find a Property CaptionClass, enter ‘99999,5050’):Disable Tools Zoom - Define CaptionClass in Field Properties
Here, 99999 will be CaptionArea, and 5050 will be CaptionRef in Codeunit 1. This will allow to distinguish for which table Tools > Zoom function should be disabled.

3. Run form in question again, and click Tools > Zoom.

Result! It seems, as if nothing happens when you click Tools > Zoom. In fact, the Zoom form, is being opened, but it errors because of our new function in Codeunit 1. In fact, you would get similar result (of “nothing happens”), if you would try to open table directly in Object Designer.

That’s one of the things… that is really good to know, but I doubt, I will use it in the future. Not the nicest way of modifying Dynamics NAV, is it?

Related Links

Technorati Tags: , , , , ,

This entry was posted in development, Dynamics NAV / Navision and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *