Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

@ ... BUTTON

@ nRow, nCol BUTTON oBtn CAPTION cCaption [SIZE nWidth, nHeight] [ACTION uAction] OF oWnd

Creates a button and binds its click action.

@ ... BUTTONAdvPL
01 · OVERVIEW

Overview

The eAdvpl reference guide, §3.10, p. 14, records the historical variant shown in the syntax. Fragments assume the matching environment and command definitions; they are not a complete application. In the historical variant, CAPTION supplies the label and OF identifies the window. TButton documentation also provides New/Create construction; examples using other includes may use PROMPT. Do not mix keywords from different variants. Execute the action when the event occurs, rather than calling it while constructing the screen. (Refs. 1–2)

02 · SYNTAX

Syntax

@ nRow, nCol BUTTON oBtn CAPTION cCaption [SIZE nWidth, nHeight] [ACTION uAction] OF oWnd

Parameters

nRow, nCol
NumericRequired

Origin position in the units of the selected variant.

oWnd / oDlg
ObjectRequired

Existing parent window; use the identifier from the actual code.

cCaption
CharacterRequired

Visible button label.

Return value

Interface/printing command; do not use as a function-return expression.

03 · PRACTICAL EXAMPLE

Commented example

// Historical eAdvpl fragment: oDlg must already exist.
Local oBtn
@ 2, 2 BUTTON oBtn CAPTION "Check" ;
    SIZE 12, 1 ACTION Alert("Action requested") OF oDlg
Expected result

Proposes a button displaying a message on click without writing data. Test ACTION expansion in the selected include. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Validate inputs and authorization inside the action. Prevent duplicate clicks in write operations; disabling a button does not replace server-side validation.
  • 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.10, p. 14. Cópia pública histórica; autoria e compatibilidade atual não confirmadas. Accessed on 2026-10-24.
  2. TOTVS. Classe TButton. TOTVSTEC/TDN. Accessed on 2026-10-24.
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