Menu Designer

fmhiguefmhigue Member Posts: 290
edited 2005-02-16 in Navision Attain
Hi everybody:

How can I hide an option on the Menu Designer to be only visible for certain companies?

I got Form 44 - Credit Memos, on the form I got Post button inside this button I added an option call Returh Authorization but I will like to let only certain companies to see it.

Thank you in advance

Comments

  • fbfb Member Posts: 246
    Unlike most other controls, you cannot set the VISIBLE or ENABLED property for a MenuItem at run time. The only dynamic property available is to display a check mark:
    For a menu item, the setting of SourceExpr must evaluate to boolean. TRUE means that the menu item will appear checked, FALSE that it will appear unchecked (normal).
    Here's a possible workaround:
    • Create two 'Post' MenuButtons, one with the ReturnAuth menuitem, one without it.
    • Give the two buttons Names -- e.g. 'mnuPostNoReturn' and 'mnuPostWithReturn'.
    • Stack the buttons on top of each other.
    • In the form's OnOpen trigger, figure out which button you wish to show, and set the VISIBLE properties accordingly.
      ShowReturn := FigureOutIfReturnShouldShow(COMPANYNAME);
      CurrForm.mnuPostNoReturn.VISIBLE(NOT ShowReturn);
      CurrForm.mnuPostWithReturn.VISIBLE(ShowReturn);
      
  • pdjpdj Member Posts: 643
    fb wrote:
    The only dynamic property available is to display a check mark
    NICE! I never noticed that! Is that used anywhere in the standard application?
    Regards
    Peter
  • fbfb Member Posts: 246
    pdj wrote:
    Is that used anywhere in the standard application?
    Not that I know of. Nor have I ever used it -- which raises the possibility that this is a 'documentation only' feature -- just because the C/SIDE guide says so doesn't necessarily mean that it works!
  • jreynoldsjreynolds Member Posts: 175
    fb wrote:
    just because the C/SIDE guide says so doesn't necessarily mean that it works!
    It works.
  • jreynoldsjreynolds Member Posts: 175
    jreynolds wrote:
    It works.
    Actually, I just discovered that this does not work if there is a subform on the form and the subform has focus when the menu button is clicked. Results are unpredictible from producing the wrong results to generating errors. A work around is to set the FocusOnClick property for the menu button to Yes.
Sign In or Register to comment.