show /hide command button by company

Hello, I don’t know how to show or not some command button on menu forms depending on the Company. Do you? Thank You

Hi! What about something like thatOnOpenForm() IF (COMPANYNAME = 'CRONUS') THEN CurrForm.Button.VISIBLE(FALSE) ELSE CurrForm.Button.VISIBLE(TRUE); Regards, Jörg

Or for those of us that avoid code: OnOpenForm() CurrForm.Button.VISIBLE(CompanyName = ‘Cronus’); The other option is to put a flag on the Company Information table. This allows you to rename the company without having to redo your code (It does happen…I’ve had to mop up after someone who did the above): OnOpenForm() CompanyInfo.GET; CurrForm.Button.VISIBLE(CompanyInfo.“Show All Buttons”); Note that no matter how you do it, it will become a maintenance headache…it starts with one button per company…then progresses to different buttons by user…good luck :slight_smile:

Check out how Navision 3.70 dynamically builds your main menu based on license and user permissions!

Thanks I didn’t knew (or forgot)that we could use the name itself of a button. Stupid Am I But with this code what appends if the user changes the name of its company. Other question: with Menu buttons, how to hide only one or two menu options? If I give a specific name, it replaces the CaptionML.

quote:


Other question: with Menu buttons, how to hide only one or two menu options?


As far as I know, you can’t … you have to create two MenuButtons, containing different menues, and do “VISIBLE or not”-game … Regards, Jörg