cAliasSX2/SX3 alias.
AdvPL GuideBuildExpr( <cAlias>, [oWnd], <cFilter>, [lTopFilter], [bOk], [oDlg], [aUsado], [cDesc], [nRow], [nCol], [aCampo], [lVisibleTopFilter], [lExpBtn], [cTopFilter] ) --> cRetOpens a dictionary-driven visual filter-expression builder.
BuildExpr uses SX2/SX3 to offer fields and construct a filter expression. The historical page lists 14 positions; cAlias and cFilter are required by the described contract, so the example explicitly supplies an empty string as the third argument while keeping Nil for the window object. Returned text is not an executed query. aUsado/aCampo can restrict fields; do not freely convert received text into code or assume the builder authorizes data access. Requires an interactive session and a registered, open alias. (TOTVS, n.d., ref. 1)
BuildExpr( <cAlias>, [oWnd], <cFilter>, [lTopFilter], [bOk], [oDlg], [aUsado], [cDesc], [nRow], [nCol], [aCampo], [lVisibleTopFilter], [lExpBtn], [cTopFilter] ) --> cRetcAliasSX2/SX3 alias.
oWndReference window.
cFilterInitial expression, possibly empty.
lTopFilterAllows TOP expression; default false.
bOkValidation, dependent on oDlg.
oDlgRelated processing dialog.
aUsadoUsed/restricted fields under the page contract.
cDescExpression description.
nRowPosition row.
nColPosition column.
aCampoField configuration.
lVisibleTopFilterTOP filter visibility.
lExpBtnExpression-button control.
cTopFilterInitial TOP expression.
Character filter expression; the example only checks its length when type is C.
#Include "Protheus.ch"
User Function EdBuildex()
Local cFilter := ""
// SA1 must be open in an interactive test session.
If Select("SA1") > 0
cFilter := BuildExpr("SA1", Nil, cFilter, .F.)
If ValType(cFilter) == "C"
ConOut(cValToChar(Len(cFilter)))
EndIf
EndIf
Return NilLength depends on interaction; no filter application, query execution or record write. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.