TYPE1 for this single-entity example.
AdvPL GuideNEW MODEL TYPE nType DESCRIPTION cDescription BROWSE oBrowse SOURCE cSource [MODELID cModelID] MASTER cMasterAliasGenerates MVC structure through a preprocessor command.
In the consulted public FWMVCDef.ch copy, NEW MODEL is an #xcommand expanding browse, ModelDef, ViewDef and, in one variant, MenuDef. TYPE 1 represents one entity; types 2/3 require a relation. This example uses fictitious ZZ1 only and must not be combined with duplicate manual definitions of generated functions. The GitHub copy is an analysis reference, not an official distribution or proof of current-LIB compatibility. (Sources: refs. 1–3.)
NEW MODEL TYPE nType DESCRIPTION cDescription BROWSE oBrowse SOURCE cSource [MODELID cModelID] MASTER cMasterAliasTYPE1 for this single-entity example.
DESCRIPTIONDescriptive title.
BROWSEVariable receiving the generated browse.
SOURCERoutine base name.
MODELIDModel ID distinct from the User Function.
MASTERDictionary-registered alias.
Preprocessor command; not a single-return function.
#Include "Protheus.ch"
#Include "FWMVCDef.ch"
User Function Ed557()
Local oBrowse
// Requires ZZ1 in SX2/SX3 and review of generated permissions.
NEW MODEL ;
TYPE 1 ;
DESCRIPTION "Test register" ;
BROWSE oBrowse ;
SOURCE "ED557" ;
MODELID "ED557M" ;
MASTER "ZZ1"
// The command itself expands Return and Static MVC functions.When compiled and called in a prepared environment, the routine opens the generated browse; it was not executed. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.