Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

Browses, grids and tabular data entry

Separates row presentation, editing and persistence.

Browses, grids and tabular data entryAdvPL
01 · OVERVIEW

Overview

A browse can display array rows or a data context without defining a write policy. The official TCBrowse example associates SetArray with the row collection and bLine with the current row projection through nAt. The fragment assumes a TCBrowse object already constructed in a dialog with two columns and uses fictional data. It enables neither editing nor persistence. For tabular entry, separately define cell validation, row insertion/deletion, cancellation and transaction confirmation; selecting a visual control does not implement those rules. (TOTVS, n.d., ref. 1)

Return value

No single return value: this is a composite workflow.

03 · PRACTICAL EXAMPLE

Commented example

// Fragment: oBrowse is a TCBrowse created with two columns.
// aRows must remain accessible for the control lifetime.
aRows := {{"A", 10}, {"B", 20}}
oBrowse:SetArray(aRows)
oBrowse:bLine := {|| {aRows[oBrowse:nAt][1], aRows[oBrowse:nAt][2]}}
Expected result

Proposes binding two rows to an existing control; not a complete program or a write demonstration. Declare variables in the caller. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Handle empty collections and nAt bounds before projecting rows. Keep display callbacks free of writes; define data ownership and cancellation strategy.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Classe TCBrowse. TDN. Exemplo SetArray/bLine. 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