Menu Button / Menu Items

How do i disable menu items of a menu button by writting codes. For example ifsuppose i have a menu button with menu items 1 and 2.

x = Boolean

IF x = True then begin
menu item 1 = Enabled
menu item 2 = Disabled
end

IF x = False then begin
menu item 1 = Disabled
menu item 2 = Enabled
end

Can someone iterpret this Navision wise using C/Side Codes

Thanks

You can’t do this with code. A work around could be to create 2 buttons. Then set the visible property in code (of the button/not the menu item).