Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

SET DELETED

SET DELETED ON | OFF

Controls visibility of deletion-marked records.

SET DELETEDAdvPL
01 · OVERVIEW

Overview

ON/.T. hides deleted records; OFF/.F. allows them in applicable navigation. It neither recalls nor physically removes records. Direct SQL requires its own D_E_L_E_T_ condition rather than inheriting navigation filtering. The example sets and restores the option without opening tables. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

SET DELETED ON | OFF
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
#Include "set.ch"

User Function Ed652()
    Local xPrevious
    // Preserve state so the caller retains its original behavior.
    xPrevious := Set(_SET_DELETED,.T.)
    ConOut(cValToChar(Set(_SET_DELETED)))
    Set(_SET_DELETED,xPrevious)
Return Nil
Expected result

Displays the temporary setting and restores the original on normal completion. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Ensure restoration on error exits as well. Use constants from installed set.ch instead of magic numbers.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Set: parâmetros e valores anteriores. Accessed on 2026-10-28.
  2. Guia de referência eAdvPL. §1.1–1.2, sintaxe histórica. Accessed on 2026-10-28.
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