Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

Retention, archiving and purging in Protheus

Plans data lifecycle before removing records.

Retention, archiving and purging in ProtheusAdvPL
01 · OVERVIEW

Overview

Retention determines availability needs, archiving preserves access outside active operations, and purging removes data under an approved policy. D_E_L_E_T_ logical deletion is neither physical purging nor guaranteed anonymization. Inventory tables, relationships, volume, owners and integration dependencies, agree criteria with business owners, and confirm module-supported maintenance. This guide sets no legal retention periods and supplies no generic DELETE. On SQL Server backups differ from queryable archives: test restore and reconciliation before maintenance. (Sources: refs. 1–2.)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed622()
    // Fictional inventory; neither purges nor defines a retention period.
    Local aPlan := {{"ZZ1","OWNER","CRITERION_PENDING"}}
    ConOut(Len(aPlan))
Return Nil
Expected result

One planning item, without database access. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Validate restore, relationships, before/after totals and query continuity before running an approved procedure.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Desenvolvendo queries no Protheus. Accessed on 2026-10-27.
  2. Microsoft. Backup overview, SQL Server. Escopo exclusivo deste SGBD. 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