Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

EnchoiceBar

EnchoiceBar( oDlg, bOk, bCancelar, [lMensApag], [aBotoes] )

Builds a legacy confirmation and cancellation bar.

EnchoiceBarAdvPL
01 · OVERVIEW

Overview

TOTVS training describes EnchoiceBar as a function although the queue classified it as a class. It adds confirmation/cancellation buttons to a dialog and accepts extra buttons with image, block and message. Callbacks are actions: closing a window does not prove persistence. The signature is the five-argument V12 training subset rather than a universal contract for later positions. The example requires an existing oDlg and only prepares construction without invoking it. (TOTVS, n.d., Programação ADVPL Avançado, V12, pp. 23–24, ref. 1)

02 · SYNTAX

Syntax

EnchoiceBar( oDlg, bOk, bCancelar, [lMensApag], [aBotoes] )

Parameters

oDlg
ObjectRequired

Existing dialog.

bOk
Code blockRequired

Confirmation button action.

bCancelar
Code blockRequired

Cancellation action.

lMensApag
LogicalOptional

Deletion message; false by training default.

aBotoes
ArrayOptional

Additional buttons: image, block and message.

Return value

Not formalized in the consulted section; do not assume an object return.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed362()
    // Fragment: oDlg already exists; the bar is not built here.
    Local bBuild := {|| EnchoiceBar(oDlg, {|| oDlg:End()}, {|| oDlg:End()})}
Return Nil
Expected result

Callback prepared; no window closed or data persisted. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Define validation and persistence separately from visual actions. Check target SmartClient availability.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Programação ADVPL Avançado. Protheus V12, s.d., p. 23–24. Cópia pública de treinamento. Accessed on 2026-10-26.
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