Usina BRAdvPL Guide
Sign in
← All topics
ENTRY POINTUnder review

F340VALOK

User Function F340VALOK()

Validates confirmation of titles selected for compensation.

F340VALOKFINA340
01 · OVERVIEW

Overview

The page documents aTitulos in PARAMIXB[1] with logical selection at row position 8. Returning .T. confirms; .F. cancels confirmation and retains the selection screen. The official example rejects confirmation when no title is selected. This differs from the F340VLD validation stage. (Refs. 1–2)

02 · SYNTAX

Syntax

User Function F340VALOK()

Parameters

PARAMIXB[1] / aTitulos
ArrayExecution context

Titles, with logical selection at position 8. (Refs. 1–2)

Return value

Logical: .T. confirms; .F. returns to selection without confirmation.

03 · PRACTICAL EXAMPLE

Editorial example based on documentation

#Include "Protheus.ch"

User Function F340VALOK()
    // Adapted official rule: require at least one selected title.
    Local aTitles := PARAMIXB[1]
    Local nRow := 0
    Local nSelected := 0
    For nRow := 1 To Len(aTitles)
        If ValType(aTitles[nRow]) == "A"
            If Len(aTitles[nRow]) >= 8
                If ValType(aTitles[nRow][8]) == "L"
                    If aTitles[nRow][8]
                        nSelected++
                    EndIf
                EndIf
            EndIf
        EndIf
    Next
Return nSelected > 0
Expected result

Teaching proposal with behavior described in comments. Verify the context before compiling in a test environment. Under review: example not compiled or run in Protheus. Verify aliases, locks, transaction position and compatibility in the target release and patch.

04 · PRACTICAL EXAMPLE

Observed call and context

// P12.2210 caller excerpt (EURAI, ref. 2); not an entry point implementation.
// FINA340.PRX - FA340OK() -> LRET := EXECBLOCK("F340VALOK", .F., .F., {ATITULOS})
Expected result

The record shows arguments and immediate return use where present. It omits the full caller body and does not establish commit timing.

BEST PRACTICES
  • The teaching rule checks for at least one valid mark. It does not change titles or recalculate balances. Test no selection, one selected title and multiple selections.
  • A call without a fourth argument does not document a PARAMIXB layout. Preserve caller identifiers and do not invent fields or positions.
  • Test plan: compare standard and customized flows, exercise success, rejection and repetition, and inspect balances, movements and accounting as applicable.
  • Under review: example not compiled or run in Protheus. Verify aliases, locks, transaction position and compatibility in the target release and patch.

Related content

REFERENCES
  1. TOTVS. F340VALOK - Validação dos títulos marcados. TDN. Accessed on 2026-10-24.
  2. EURAI. Pontos de Entrada P12.2210 - Parte 2. Universo do Desenvolvedor, 2023. Accessed on 2026-10-24.
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