How to enable/disable my add-on in NAV?

havhav Member Posts: 299
edited 2009-10-15 in NAV Three Tier
Hi All,
I have integrated my add-on to NAV 2009. The integration includes modification to existing code and UI as well as addition of new code and UI. Once the add-on is merged with NAV code base, the application executes both my code as well as NAV code.
I am now in a requirement wherein i want to wrap my code at all places within NAV code base through some setup checking. I want to allow the user to indicate whether he wants to use plain NAV functionality or to use NAV with add-on. I can then use this setup to enable or disable my code execution inline with NAV.
Note that I have created a "Preference Card" to allow user to specify his preference setting and use this to initialize my add-on at NAV startup and to terminate my add-on at NAV closeup.
One alternative i had thought of is to provide a boolean field on "Preference Card", something like "Disable WM Add-on" and place a checking of this field at all places wherever i have integrated my code. I mean to say, "if DisableWMAddon = false then execute my code else continue"
Please let me know if you have some other alternative to achieve the above.
Our customer will receive from Microsoft a license file having granule included for our add-on. I was wondering if i can use checking of this granule to enable/disable my code execution within NAV. Is this possible?
Our customer will have a client/server setup for NAV 2009. We will be deploying our add-on on server and will access it through RTC on client machines. In this scenario, the alternative which i proposed above will not work since preference to enable/disable my add-on might change for each client.
Can i achieve this by means of Roles and Permissions? If so, please let me know how.

Regards,
Hemant
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)

Comments

  • kinekine Member Posts: 12,562
    In general, calling of some Addon code within standard objects should be conditioned by some setup (if setup for your addon exists, use the addon, if not, do not use it), but to be able to check this you need to condition this by checking readpermissions on the setup table of your addon. If you can read the table, you have permissions to use the addon.

    It is same like othe NAV functionality, you do not need to have granule for some areas and these areas will not be used when you do not set them up or when you do not have permissions to some tables.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • havhav Member Posts: 299
    My add-on does have a setup and i can use it for conditioning my code within NAV standard objects. But then how to condition my UI?
    For example, i have customized Customer Card by adding a new tab, Sales Order card by adding a new menu button, navigation pane by adding a new menu etc.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • kinekine Member Posts: 12,562
    You cannot. It is again like other area - if you have license without manufacturing module, you will still have all buttons, fields, functions there but when clicked, you will have permissions error etc. If someone do not have license for your addon, why he have the modifications in his objects? ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • havhav Member Posts: 299
    Consider the use-case where a customer has bought NAV license with add-on for 10 users. He has a setup environment where NAV db. with my add-on resides on Server and there are 10 clients accessing it. Out of 10 clients,
    (a) 5 are such who want to use add-on
    (b) 5 are such who want to use plain NAV functionality
    Both type of users will see the modifications done by the add-on. However for users of type (b) there should be some provision to restrict them from using the add-on.
    How is this possible?
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • kinekine Member Posts: 12,562
    If there is some addon, it works for everyone. I do not know about what is your addon, but e.g. if the addon have impact to some posting, you cannot say that one user will use it and another one will not use it. It will lead to inconsistent data...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • havhav Member Posts: 299
    I agree with you.

    Next i want to clarify the object id i use for my menusuite.
    We are Microsoft Gold Certified Partner and so i had created a menusuite with object id 1080 which is a Partner level. The menusuite i use is same as Dept-MBS menusuite(object id 1010) with one new menu.
    Our customer will buy license from Microsoft which will include our add-on. As i understand, there can be maximum 10 add-ons under object id 1050 to 1059.
    So do i have to change my menusuite level from Partner to Add-on? I mean from 1080 to 1050.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • kinekine Member Posts: 12,562
    Of course, yes. If it is addon, your menusuite will be in the addon range. Partner level is for changes made by partner for the customer,,,
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • havhav Member Posts: 299
    So does the license file have any impact, if i do not change the object id.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Sign In or Register to comment.