Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

AxCadastro in legacy routines

Evaluates when generic maintenance suffices and what to prepare in the dictionary.

AxCadastro in legacy routinesAdvPL
01 · OVERVIEW

Overview

Start with the table contract: custom SX2 table, SX3 fields, consistent indexes and validation rules. AxCadastro groups basic operations for simple cases; mBrowse gives the caller more control over menu composition. MARTINS’s public example uses a short SA1 call, illustrating the API without guaranteeing business rules or automatic MVC migration. Before extending a legacy routine, inventory Private cCadastro/aRotina, validation functions and each action’s effects. (TOTVS, n.d., ref. 1; MARTINS, 2023, ref. 2)

Return value

No single return value: this is a composite workflow.

03 · PRACTICAL EXAMPLE

Commented example

// Menu fragment for an already prepared legacy mBrowse.
Private aRotina := {}
AAdd(aRotina, {"Search", "AxPesqui", 0, 1})
AAdd(aRotina, {"View", "AxVisual", 0, 2})
AAdd(aRotina, {"Insert", "AxInclui", 0, 3})
AAdd(aRotina, {"Edit", "AxAltera", 0, 4})
Expected result

Configures four caller options; does not independently open a browse or execute maintenance. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Document dictionary dependencies and test with fictional data. Require equivalent validation before replacing screens.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. AXCADASTRO(). TDN. Accessed on 2026-10-26.
  2. MARTINS, Scheron. AxCadastro.prw, 22 set. 2023. Commit b12d5cb980785626e184454c968f41d5d954b932. Exemplo comunitário analisado, não reproduzido integralmente. Accessed on 2026-10-26.
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