Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

MSGetDB

MsGetDB():New(nTop,nLeft,nBottom,nRight,nOpc,[cLinhaOk],[cTudoOk],[cIniCpos],[lDelete],[aAlter],[nFreeze],[lEmpty],[uPar1],cTRB,[cFieldOk],[uPar2],[lAppend],[oWnd],[lDisparos],[uPar3],[cDelOk],[cSuperDel])

Maintains a legacy grid backed by a temporary table.

MSGetDBAdvPL
01 · OVERVIEW

Overview

Legacy class editing rows in the temporary alias supplied as constructor cTRB. Requires Private aRotina and aHeader; table layout must follow the header and contain the final logical deletion flag. Enable and Disable control interaction; ForceRefresh updates and positions at the first row. Validation callbacks must be accessible functions, not Static. This fragment covers only those three methods and creates neither table nor dialog. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

MsGetDB():New(nTop,nLeft,nBottom,nRight,nOpc,[cLinhaOk],[cTudoOk],[cIniCpos],[lDelete],[aAlter],[nFreeze],[lEmpty],[uPar1],cTRB,[cFieldOk],[uPar2],[lAppend],[oWnd],[lDisparos],[uPar3],[cDelOk],[cSuperDel])

Parameters

nTop
NumericRequired

Top bound.

nLeft
NumericRequired

Left bound.

nBottom
NumericRequired

Bottom bound.

nRight
NumericRequired

Right bound.

nOpc
NumericRequired

Action position in aRotina.

cTRB
CharacterRequired

Temporary alias used for editing.

Methods

NewConstructor: requires prepared Private context and container.MsGetDB():New(nTop,nLeft,nBottom,nRight,nOpc,[cLinhaOk],[cTudoOk],[cIniCpos],[lDelete],[aAlter],[nFreeze],[lEmpty],[uPar1],cTRB,[cFieldOk],[uPar2],[lAppend],[oWnd],[lDisparos],[uPar3],[cDelOk],[cSuperDel])
Return value

Class instance.

EnableEnables interaction.oGrid:Enable()
DisableDisables interaction.oGrid:Disable()
ForceRefreshRefreshes its data source and moves to the first row.oGrid:ForceRefresh()

Return value

New returns the object; this example does not use the other methods’ returns.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed542()
    // Requires an object already built in the correct dialog; block not invoked.
    Local bRefresh := {|oGrid| oGrid:ForceRefresh()}
    ConOut(ValType(bRefresh))
Return Nil
Expected result

Prints B. When invoked with a valid object, refresh may change the current row. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check the signature and all optional arguments in the source before construction. Restore work areas and release resources on errors. Refresh does not save data; preserve user selection and validate rows before persistence.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. MsGetDB. TDN. Accessed on 2026-10-27.
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