cKeyAliasTable alias.
AdvPL GuideGetAdvFVal(cKeyAlias,uCpo,[uChave],[nOrder],[uDef]) -> uRetLooks up a key and returns one or multiple fields.
cKeyAlias identifies the table and uCpo takes a field name or an array of names. uChave and nOrder must match the actual index, including branch and dictionary lengths; uDef supplies a fallback for missing keys. The illustrative block takes a completed key without automatically querying; SA1 must be available in the correct environment. (Sources: refs. 1–1.)
GetAdvFVal(cKeyAlias,uCpo,[uChave],[nOrder],[uDef]) -> uRetcKeyAliasTable alias.
uCpoField or field list.
uChaveComplete index key.
nOrderIndex order.
uDefCompatible fallback.
Field value or array of values.
#Include "Protheus.ch"
User Function Ed463()
// Complete key according to test-environment SIX and SX3.
Local bLookup := {|cKey| GetAdvFVal("SA1",{"A1_NOME","A1_TIPO"},cKey,1,{"",""})}
ConOut(ValType(bLookup))
Return NilPrepares a two-field lookup with a two-position fallback array. 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.