cAliasTable; current area by default.
AdvPL GuidexFilial([cAlias],[cFil]) -> cBranchGets the table branch according to its sharing configuration.
xFilial considers SX2 table sharing. Its value may be the applicable branch or spaces, including company-level sharing; it is not simply cFilAnt. Omitted cAlias uses the current area; omitted cFil uses cFilAnt. Historical examples show different widths: do not hardcode two spaces for current installations. This adaptation of Atilio explicitly queries SB1 without building a lookup or changing company context. (Sources: refs. 1–2.)
xFilial([cAlias],[cFil]) -> cBranchcAliasTable; current area by default.
cFilReference branch; defaults to cFilAnt.
Character representation of the table branch.
#Include "Protheus.ch"
User Function Ed733()
// Requires initialized Protheus context and valid SB1 dictionary.
Local cBranch := xFilial("SB1")
// The value participates in keys; do not AllTrim it for lookups.
ConOut(ValType(cBranch))
Return NilDisplays C; content and width depend on configuration. 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.