Entry points in MVC routines
PARAMIXB = {oObject,cEvent,cForm,...}Dispatches received event IDs with event-specific returns.
Overview
The standard MVC entry point is a User Function named after the Model ID and receives an array: object [1], event [2] and form/submodel [3]. Extra arguments vary by event. MODELPOS needs logical; BUTTONBAR needs a structured array. MODELCOMMITTTS runs after full persistence inside the transaction; MODELCOMMITNTTS after persistence outside it, with no expected return. TOTVS notes MODELPOS can run for validation and the model event: do not assume a single call. The community sample demonstrates dispatch but its commit description differs from the official table; the latter is authoritative. (Sources: refs. 1–3.)
Syntax
PARAMIXB = {oObject,cEvent,cForm,...}Commented example
#Include "Protheus.ch"
User Function Ed573()
Local aEnvelope := {Nil,"MODELPOS","EDMASTER"}
// Synthetic envelope: not a universal entry-point implementation.
If Len(aEnvelope) >= 3
If ValType(aEnvelope[2]) == "C"
ConOut(aEnvelope[2])
EndIf
EndIf
Return NilPrints MODELPOS. Neither validates a real model nor commits. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Handle every event requiring a return and check extra positions before reading. Do not infer a grid solely from Len > 3. Keep validation free of external side effects and make integrations idempotent.
- 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.