Usina BRAdvPL Guide
Sign in
← All topics
FOUNDATIONUnder review

SX2 — Tables

Describes tables recognized by the dictionary.

SX2 — TablesAdvPL
01 · OVERVIEW

Overview

SX2 describes tables, SX3 their fields and SIX their indexes. Do not turn logical aliases such as SB1 into physical names with fixed suffixes. The community RetSQLName example resolves names from SX2 configuration and context. This subset only prepares that lookup without opening a table or executing SQL. Resolution does not prove physical existence, authorized access or correct branch/deletion filtering. (Sources: refs. 1–3.)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed682()
    // Resolve in current context without fixing a company suffix.
    Local bPhysicalName := {|| RetSQLName("SB1")}
    ConOut(ValType(bPhysicalName))
Return Nil
Expected result

Creates block B; neither queries the database nor assumes SB1010. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Keep tables, fields, indexes and sharing rules consistent through supported Configurator tools.
  • 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_421_Funcao_RetSQLName.prw. Arquivo completo consultado; adaptação editorial. Accessed on 2026-10-28.
  3. Atilio. dan-atilio/AdvPL. Maratona de Exemplos/Exemplo_250_Classe_FWSX2Util.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