Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

GETNEWPAR()

GetNewPar(cParametro,uPadrao,[cFilial]) -> uValue

Reads a system parameter in branch context.

GETNEWPAR()AdvPL
01 · OVERVIEW

Overview

Reads SX6 with a fallback and optional branch. The fallback applies when the parameter is missing, not merely empty. The historical page also mentions help on absence and contrasts SuperGetMV: do not promise silent behavior on every release. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

GetNewPar(cParametro,uPadrao,[cFilial]) -> uValue

Parameters

cParametro
CharacterRequired

SX6 parameter name without branch.

uPadrao
AnyRequired

Fallback when absent.

cFilial
CharacterOptional

Optional branch; connection default.

Return value

Value according to parameter type.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed471()
    // Execute only in a prepared test environment.
    Local bRead := {|| GetNewPar("MV_DIAS",45)}
    ConOut(ValType(bRead))
Return Nil
Expected result

Prepares block B; reading depends on the environment and does not occur here. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Use a fallback of the expected type and document missing-parameter policy.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. GETNEWPAR%28%29. TDN. Accessed on 2026-10-27.
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