DBDelete
DBDelete()Marks the current record for logical deletion.
Overview
DBDelete marks the current record rather than physically removing every record. The TOPCONN reference describes R_E_C_D_E_L_ control; use the proper API instead of manually editing control columns. The fragment acts only after obtaining RecLock on an owned-table record. Do not transfer it to business tables without module routines and validation. EDTRB identifies only an owned test table already open with the required schema and permissions; examples are not intended for standard tables. (TOTVS, n.d., ref. 1)
Syntax
DBDelete()Return value
Return not formalized by the consulted page; unused in the example.
Commented example
#Include "Protheus.ch"
User Function Ed330()
// EDTRB is disposable; test record already located.
If Select("EDTRB") > 0
If !EDTRB->(Eof())
If RecLock("EDTRB", .F.)
EDTRB->(DBDelete())
EDTRB->(MsUnlock())
EndIf
EndIf
EndIf
Return NilOn successful lock, requests logical deletion of the test record; full error handling is not implemented. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Check RDD, alias and pending operations. Navigation can flush updates; preserve context under the caller contract and handle errors in the complete routine.
- 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.