Trigger executing a report
Field event → prepare context → explicit action → reportSeparates a field event from report execution.
Overview
SX7 represents rules triggered by field events. It is not a confirmed-save event: editing may repeat or be cancelled. This editorial workflow recommends preparing data in the trigger and running reports through an explicit action after context validation. The example only demonstrates a pure title-building function without registering SX7 or printing. (Sources: refs. 1–1.)
Syntax
Field event → prepare context → explicit action → reportCommented example
#Include "Protheus.ch"
User Function Ed462()
Local cDoc := "ED0001"
Local bTitle := {|cCode| "Document: "+AllTrim(cCode)}
// Local transformation without calling a printing routine.
ConOut(Eval(bTitle,cDoc))
Return NilBuilds a title with a fictional document; no report is triggered. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- For automatic output, document idempotency, cancellation, expected return and caller permissions.
- 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.