Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

MVC structures: fields, properties and triggers

Separates Model and View metadata before defining rules.

MVC structures: fields, properties and triggersAdvPL
01 · OVERVIEW

Overview

FWFormStruct provides metadata structures for Model (type 1) or View (type 2). Its bSX3 block receives a field identifier and returns a logical inclusion decision. Selecting View fields does not replace a Model validation rule; a trigger needs a defined event, source, target and effect. The example only creates a Model structure for fictional dictionary-registered ZZ1 and selects ZZ1_COD. It neither defines a real trigger nor builds a complete application; additional properties and signatures require their class documentation. (TOTVS, n.d., ref. 1)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
User Function Ed369()
    Local oStructure
    // Requires ZZ1 and ZZ1_COD in the test dictionary.
    oStructure := FWFormStruct(1, "ZZ1", {|cField| AllTrim(cField) == "ZZ1_COD"})
Return oStructure
Expected result

Structure object for the prepared context; no persistence or View activation. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Do not confuse presentation metadata with business rules. Preserve the caller object lifecycle.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWFormStruct. TDN. 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