AxCadastro in legacy routines
Evaluates when generic maintenance suffices and what to prepare in the dictionary.
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.
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})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.
- 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.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.