SET DELETED
SET DELETED ON | OFFControls visibility of deletion-marked records.
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.)
Syntax
SET DELETED ON | OFFCommented 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 NilDisplays 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.
- 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.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.