Options

Trying to manage a control(menuitem)

rmcmachrmcmach Member Posts: 3
Is there any way that i can manage the ENABLE property of a MENU ITEM in a button of a form?

This MENU ITEM doesn´t appear in the Controls of the CurrForm variable...so where is it?

Anyone knows?

Comments

  • Options
    DenSterDenSter Member Posts: 8,304
    It is not possible to dynamically enable or disable menu items on Navision forms.
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Hi,

    You can make 2 buttons, one with and one without the option, place them on top of each other and make one of them visible/unvisible,

    If you do this, write code in functions for mainenance,

    But then again: Always write menu item code in funcions :D
  • Options
    rmcmachrmcmach Member Posts: 3
    thanks, but it is a menu item inside a MENUBUTTON...you know...with identations and stuff...well i think its impossible
    [-(

    But that duplication might give me en ideia, and functions...mmmm :-k
  • Options
    DenSterDenSter Member Posts: 8,304
    I think we know exactly what you mean rmcmach, and it is not possible to dynamically control menuitems in Navision. The only way to come close is like Mark said. Have multiple 'versions' of the button and make one of them visible depending on certain conditions.

    Make sure you listen carefully to what he said about putting the code in functions, not in the OnPush trigger of the menuitems themselves. Use that trigger only to call the function, so that you only have to maintain the code in one place.
  • Options
    KowaKowa Member Posts: 918
    The visible/nonvisible trick is useful for customization, but should not be used for any certified add-on because the style guide forbids it. :roll:
    Kai Kowalewski
Sign In or Register to comment.