Usina BRAdvPL Guide
Sign in
← All topics
FOUNDATIONUnder review

SX3 — Fields

Defines field structure and properties.

SX3 — FieldsAdvPL
01 · OVERVIEW

Overview

SX3 connects structure and presentation: field consumers must respect type, length, decimals and rules. Avoid hardcoded product-code length when dictionary configuration can vary. The community example reads length/decimals from TamSX3’s first two positions; this adaptation validates type/length before indexing without claiming those are all possible positions. It changes no metadata and its result depends on configuration. (Sources: refs. 1–2.)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed683()
    Local aInfo := TamSX3("B1_COD")
    // Validate the observed shape before indexing.
    If ValType(aInfo) == "A"
        If Len(aInfo) >= 2
            ConOut(aInfo[1])
            ConOut(aInfo[2])
        EndIf
    EndIf
Return Nil
Expected result

On a prepared environment displays B1_COD length/decimals if the return matches the expected shape. Values are not fixed here. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Length changes require reviewing field groups, indexes, integrations and physical schema; use supported tooling and validate dependencies.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Dicionário de Dados: tabelas, funções e usos. Accessed on 2026-10-28.
  2. Atilio. dan-atilio/AdvPL. Maratona de Exemplos/Exemplo_469_Funcao_TamSX3.prw. Arquivo completo consultado; adaptação editorial. Accessed on 2026-10-28.
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