KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to service multiple Menu Items from one Project Method
PRODUCT: 4D | VERSION: 13.0 | PLATFORM: Mac & Win
Published On: June 29, 2012

When building menus for a Menu Bar the common practice is to either assign a common aciton to a Menu Item, such as Select All, or associate a Project method with the Menu Item. A little used feature in 4D Menus is the Custom parameter property.

The Custom parameter property can be set in either the Menu editor, shown below...



of by using the command SET MENU ITEM PARAMETER.

With the Custom parameter property the developer can have multiple Menu Item call a single Project method and based on the Custom parameter preform a different or modified action.

The Custom paramter is not passed to the Project method as a parameter but has to be acquired using the 4D Command Get selected menu item parameter in the Project method.

Warning: do not use the Custom parameter property in conjunction with Start a new process property. The Custom parameter is only available in the process in which the menu was accessed and is not passed to the newly launched process.