The very first codeunit which is run

sabzamsabzam Member Posts: 1,149
Dear All,

I need to restrict the navision when choosing the menusuite to particular one according to the user. I was hoping to either limit it through the permissions or else to modify the very first codunit which is run. What do you think and does anyone know which is the very first codeunit?

Comments

  • DenSterDenSter Member Posts: 8,305
    That would be codeunit 1. There's a function called LoginStart (I think that's what you're looking for) that you can add functionality to. Try putting a message in there and see which one you need.
  • sabzamsabzam Member Posts: 1,149
    I must have not explained myself correctly. I need the codeunit which is run everytime that the company is chagned (but not the database)
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Codeunit 1, function CompanyOpen.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • sabzamsabzam Member Posts: 1,149
    By Any chance does anyone know where to put the code to force the Navision to decide which menusuite to shiow?
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Why don't you use the "Assign Users" functionality to assign users to MenuSuite's?
    First select Tools -> Navigation Pane Designer. Then right-click on the MenuSuite (for example: Financial Mangement) and select "Assign Users". Now you can select the users who may access the MenuSuite. Finally select File -> Save to save your changes.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • sabzamsabzam Member Posts: 1,149
    I thought of that but what if I don't want a user to access the folder Marketing in the Sales and Marketing Tab for one company but not for the other?
  • kinekine Member Posts: 12,562
    If the user will not have access to the tables, the menu items will not be showen. You can use this to prevent users to have access to permited tables. This can be different for each company. Just the group will be still there, if not just forms are there...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • AsallaiAsallai Member Posts: 141
    It's better way if you play with permissions. create a new one for the menu sites. or create new fields (boolean) in the user table for these.
  • sabzamsabzam Member Posts: 1,149
    I perfectly agree that it would have been the ideal solution but not when the client wants the users to have read permission for the customers for example but no access at all for the reports.
  • kinekine Member Posts: 12,562
    Than you need to set permissions per object (reports), not only on table level.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.