Usina BRAdvPL Guide
Sign in
← All topics
FOUNDATIONUnder review

SX5 — Generic tables

Organizes generic-table codes and descriptions.

SX5 — Generic tablesAdvPL
01 · OVERVIEW

Overview

SX5 holds code domains used by routines. The community example distinguishes positioned-record fDescSX5 from SX5Desc, which receives generic-table identifier and key. Displaying a description does not validate business-rule eligibility. The block uses table 02/key PI from the source without assuming the record exists or has identical descriptions in every language. (Sources: refs. 1–2.)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed684()
    // Community lookup pattern; block not invoked.
    Local bDescription := {|| SX5Desc("02","PI")}
    ConOut(ValType(bDescription))
Return Nil
Expected result

Creates block B without reading or writing SX5. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check table, key, branch and language; handle missing entries without fabricating a successful description.
  • 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_172_Funcao_fDescSX5_e_SX5Desc.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