Can I Modify by coding a property in Button menu Items ?

fgodefroidtfgodefroidt Member Posts: 11
Hi,

I have a button with menu items into a form. Sometimes, i need to modify the "Visible" property by the code. There is no functions in CurrForm, or Controls for Access to something like that : MyButton.NameItem.Visible:=TRUE;

Or perhaps it's not possible ?

Please Help

Fred,
Beginner Navision Programmer :-k

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    This is not possible. You can't make menuitems visible or not-visible as you can do with regular controls.

    Only solution is to create multiple menu-buttons on top of each other with the different combinations of menuitems. Then you can make one menu-button visible, and hide the other menu-buttons, using C/AL Code.

    Drawback is of course you need to maintain multiple menu-buttons when new menuitems are added, and that you end up with multiple menu-buttons when various combinations of menuitems exists.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • WiLLy_CoYoTeWiLLy_CoYoTe Member Posts: 7
    You must modify the name of the button...
    and the you find the control in the CurrForm.MenuButton.VISIBLE properties.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    If you want to make the menu-button visible or not visible using code, you need indeed to use the Name-property.

    If you want to make the individual menu-items visible or not visible, you need the approach as discussed before.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • fgodefroidtfgodefroidt Member Posts: 11
    Thanks for anwers.

    It's my real problem : I can't see the individual menu item
    There is only the main button in Currform\
    And no individual items in CurrForm\MyButton\....

    I wonder if it's reallly possible....

    Fred
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can't see/use the individual menu-items with CurrForm.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • fgodefroidtfgodefroidt Member Posts: 11
    I can see only my main button...
    Is there a bug in the version FR 5.00 ?

    So there is no solution other create many buttons and only set visible the correct one ?
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    How many menu-buttons do you have on your form?
    Does each menu-button has a value in the Name-property (with other words: does each menu-button has a name assigned)?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • fgodefroidtfgodefroidt Member Posts: 11
    I have only one button with menu options, do I will make many buttons with the 3 cases I have.
    Thanks.
  • DenSterDenSter Member Posts: 8,305
    It is not possible to enable or disable individual menu-items. This is not a bug, but that's the way it works, unfortunately.
Sign In or Register to comment.