Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

ADD MENUITEM

ADD MENUITEM <oItem> CAPTION <cCaption> [ACTION <uAction>] OF <oMnu>

Adds an action to an existing menu.

ADD MENUITEMAdvPL
01 · OVERVIEW

Overview

Historical eAdvpl reference, §3.5, p. 12. Syntax depends on that environment’s definitions; it does not establish compatibility with every current Protheus include. OF identifies the parent menu rather than the window. Evaluate the action when the user selects the item. The example displays a message without changing data; real operations must revalidate arguments and permissions inside their action. (Guia de referência eAdvpl, s.d., ref. 1)

02 · SYNTAX

Syntax

ADD MENUITEM <oItem> CAPTION <cCaption> [ACTION <uAction>] OF <oMnu>

Parameters

oItem
ObjectRequired

Created item variable.

cCaption
CharacterRequired

Item caption.

uAction
AnyOptional

Selection action.

oMnu
ObjectRequired

Existing parent menu.

Return value

No business return value is documented for this interface operation.

03 · PRACTICAL EXAMPLE

Commented example

// Historical fragment: oMnu already exists.
Local oItem
ADD MENUITEM oItem CAPTION "Check" ;
    ACTION Alert("Inquiry requested") OF oMnu
Expected result

Proposes an item displaying a message when selected; it performs no writes. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Prevent duplicate triggering of long tasks and end callbacks with their owning objects.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. Guia de referência eAdvpl. §3.5, p. 12. Referência histórica; autoria e compatibilidade atual não confirmadas. Accessed on 2026-10-25.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha