Usina BRAdvPL Guide
Sign in
← All topics
ENTRY POINTUnder review

F040FAC

ExecBlock("F040FAC", .F., .F., nSavRec)

Extends recording of the FACS title generated in accounts receivable. Technical contract under review.

F040FACFINXFINExecBlockPARAMIXBFACS
01 · OVERVIEW

Overview

The official index associates F040FAC with supplementary recording of the FACS title in accounts receivable. Its row lists MATXATU and FINXFIN; the specific entry remains marked “Em construção” (under construction). (TOTVS, s.d., ref. 1) The MTFUNDOS manual, updated on August 8, 2022, identifies FACS as Fundo de Apoio a Cultura da Soja. This historical context explains the acronym without establishing its current fiscal applicability. (TOTVS, s.d., ref. 4) FINA040 documentation includes the “Vlr. FACS” and “Parc. FACS” fields. They help identify the topic in the functional process but do not prove which fields or aliases will be available inside this entry point. (TOTVS, s.d., ref. 5) The public listing shows FINXFIN calling ExecBlock("F040FAC", .F., .F., nSavRec). (TOTVS, s.d., ref. 2) The generic ExecBlock mechanism exposes its fourth argument through PARAMIXB rather than passing it directly through the User Function signature. (TOTVS, s.d., ref. 3)

02 · SYNTAX

Syntax

ExecBlock("F040FAC", .F., .F., nSavRec)

Parameters

PARAMIXB
ContextualExecution context

Context exposed through the fourth ExecBlock argument. It is not a required formal argument of the User Function. The listing shows nSavRec without an explicit array; actual presence, type, and meaning must be confirmed in the target release.

Return value

The specific contract has not been confirmed in the public sources located. The bare Return belongs only to the diagnostic example and does not establish the return required by standard processing.

03 · PRACTICAL EXAMPLE

Diagnostic example

#Include "Protheus.ch"



User Function F040FAC()

    Local uContext := Nil



    // The variable may reflect a scalar value; do not assume an array.

    If Type("PARAMIXB") <> "U"

        uContext := PARAMIXB

    EndIf



    // In a test environment, log only the type, without title data.

    ConOut("F040FAC: context type = " + ValType(uContext))

Return

Expected result

When the routine actually invokes the entry point, the console should show the received type without exposing the context value. If nothing appears, first check compilation, RPO, environment, and scenario. No message does not prove that the entry point was discontinued.

BEST PRACTICES
  • Confirm the call and title generation scenario in the target release and patch.
  • Preserve work areas if future customization selects or repositions aliases.
  • Start by diagnosing the PARAMIXB type without printing title data.
  • Compare processing without customization and with this example in a test environment.
  • Record the validated version and retain didactic comments in the code.
  • The fiscal index documents MV_FACNAT as the FACS nature and MV_AGFETHA as controlling the grouping of FETHAB, FACS, and FABOV titles. (TOTVS, s.d., ref. 6) Treat them as environment diagnostic checkpoints, not as entry point arguments or proof of its execution timing.
COMMON PITFALLS
  • Do not assume PARAMIXB is an array or that PARAMIXB[1] represents the context.
  • Do not infer the received table or record solely from the name nSavRec.
  • Do not assign undocumented authorization or cancellation semantics to .T./.F. returns.
  • Do not assume execution after commit, a record lock, or a positioned alias.
  • The example has neither been compiled nor executed in Protheus; full source verification remains pending.

Related content

REFERENCES
  1. TOTVS. Pontos de Entrada - Financeiro - P12. TDN. Indexed evidence consulted on 2026-10-20.
  2. TOTVS. Pontos de Entrada. TDN. Indexed evidence consulted on 2026-10-20.
  3. TOTVS. ExecBlock - Execução do ponto de entrada. TDN. Indexed evidence consulted on 2026-10-20.
  4. TOTVS. MTFUNDOS - FETHAB, FACS, FABOV, FAMAD e IMA do Estado do Mato Grosso. TDN. Indexed evidence consulted on 2026-10-20.
  5. TOTVS. Contas a Receber - FINA040 - Financeiro - P12. TDN. Indexed evidence consulted on 2026-10-20.
  6. TOTVS. Fiscal - Protheus 12. TDN. Indexed evidence consulted on 2026-10-20.
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