ModelDefCreates and returns the data model, entities, relationships, validations and persistence.
AdvPL GuideModelDef() · ViewDef() · MenuDef()Organize business rules, presentation and operations in a Protheus routine with MVC.
In AdvPL Framework MVC, ModelDef defines the model and business rules, ViewDef builds the interface connected to that model, and MenuDef declares available operations. The framework supplies the controller behavior. This separation allows the model to be reused by interfaces, automated routines and integrations.
ModelDef() · ViewDef() · MenuDef()ModelDefCreates and returns the data model, entities, relationships, validations and persistence.
ViewDefCreates and returns the interface, links the model and arranges forms, grids and containers.
MenuDefReturns routine operations; FWMVCMenu() may generate the standard set.
#Include "TOTVS.ch"
#Include "FWMVCDef.ch"
// Same structure as the Portuguese example;
// user-facing texts can be localized.ModelDef owns the model, ViewDef connects the interface, and MenuDef supplies operations.
© 2026 Usina.BR. Todos os direitos reservados. TOTVS, Protheus, Microsiga e seus respectivos logotipos são marcas de titularidade da TOTVS S.A. AdvPL é uma linguagem de programação desenvolvida pela TOTVS. O AdvPL Guia é um projeto independente, sem vínculo, representação, patrocínio ou afiliação com a TOTVS S.A., suas franquias ou representantes.