Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Hull and Outfitting

Addition of Menu Items

  • Last UpdatedNov 13, 2025
  • 2 minute read

To add menu fields to an application, proceed as follows:

Create an APPMENU object:

!menu = object APPMENU('menuName')

This associates the object with the menu named menuName on the main form, creating the menu if it does not already exist.

Add items to the menu using the methods of the APPMENU object.

The arguments for these methods are exactly the same as the menu creation functions provided by PML. A unique fieldname for each field in a menu can be specified.

You may specify a field name when adding menu items in this way; if no field name is specified, then the Dtext of the menu field is used as the field name. To add to the end of the menu, use the commands

!menu.add('<FieldType>', '<Dtext>', '<Rtext>', {'<FieldName>'})

!menu.add('SEPARATOR', {'<FieldName>'}).

Notes: If a menu field with the same field name is already present, the field will not be added. This is so two add-ins can define the same menu field, and it will appear independently of whether one or both add-ins are present.

This method does not always add an item to the end of the menu. If a function tries to add a menu field with the same field name as one that’s already present, the next menu field created (unless it’s inserted explicitly before or after another field or it’s a separator) will appear after the existing field. The reason for this is to preserve the intended order of the fields.

To insert a new field relative to existing named field, use

!menu.insertBefore('<TargetFieldName>', '<FieldType>', '<Dtext>', '<Rtext>' {, '<FieldName>'})

!menu.insertAfter('<TargetFieldName>', '<FieldType>', '<Dtext>', '<Rtext>' {, '<FieldName>'})

!menu.insertBefore('<TargetFieldName>', 'SEPARATOR' {, '<FieldName>'})

!menu.insertAfter('<TargetFieldName>', 'SEPARATOR' {, '<FieldName>'}).

To register the APPMENU object with !!appMenuCntrl, specifying the applications in which the menu field should be visible, use:

!appMenuCntrl.addMenu('APP', !menu)

It is possible to add menu fields from an APPMENU object to every application. The application name 'ALL' has been reserved for this purpose.

Related Links
TitleResults for “How to create a CRG?”Also Available in