---
id: post/gerardorenteria-blog/15213
type: post
title: "🧹 Cleaning and anonymizing copies in Business Central: environments, companies, and traceability"
summary: A reusable solution for automatically anonymizing sensitive data, marking copied companies, and adjusting settings when copying Business Central environments or companies. It provides table and field configuration, manual or event-triggered execution, and comprehensive logging for audit trails.
tier: community
language: es
tags:
  - data anonymization
  - environment copy
  - company copy
  - cleanup workflow
  - event handling
  - audit logging
  - pseudonymization
  - data privacy
system: administration
review:
  state: reviewed
  by: opus
  at: "2026-10-07T23:47:17.757Z"
  flags: []
generated:
  at: "2026-10-07T22:42:12.892Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 03508df2093b8bc7f59badcd07aa15b40e52069d78a168f1328092286874d6ea
evidence:
  - kind: blog
    url: https://gerardorenteria.blog/2026/08/20/%f0%9f%a7%b9-cleaning-and-anonymizing-copies-in-business-central-environments-companies-and-traceability/
    title: "🧹 Cleaning and anonymizing copies in Business Central: environments, companies, and traceability"
    date: "2026-08-20"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://gerardorenteria.blog/2026/08/20/%f0%9f%a7%b9-cleaning-and-anonymizing-copies-in-business-central-environments-companies-and-traceability/
    title: "🧹 Cleaning and anonymizing copies in Business Central: environments, companies, and traceability"
    date: "2026-08-20"
    commit: null
    t: null
    quote: An important part of this idea is not only executing the process, but also leaving evidence of the whole process.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "15213"
source_id: gerardorenteria-blog
source_name: Gerardo Renteria
url: https://gerardorenteria.blog/2026/08/20/%f0%9f%a7%b9-cleaning-and-anonymizing-copies-in-business-central-environments-companies-and-traceability/
published_at: "2026-08-20T09:11:19.000Z"
author: Gerardo Renteria
full_text: false
words: 2789
quotes:
  - text: An important part of this idea is not only executing the process, but also leaving evidence of the whole process.
    why_it_matters: Emphasizes the value of comprehensive logging and traceability for audit, support, and operational review
code_objects_mentioned:
  - table GDRGAnonymizeSetup
  - table GDRGAnonymizeFieldSetup
  - table GDRGCleanupSetup
  - table GDRGCompanyFeatureSetup
  - table GDRGEnvCopyLog
  - table GDRGEnvCopyLogLine
  - codeunit GDRGEnvCleanupMgt
  - codeunit GDRGEnvCleanupSubscriber
  - codeunit GDRGDataAnonymizer
  - codeunit GDRGCompanyMarker
  - codeunit GDRGPseudonymizer
  - codeunit GDRGSetupProposalMgt
  - codeunit GDRGCopyCompanySubscriber
  - codeunit GDRGCompanyFeatureAdjuster
  - enum GDRGCleanupOperation
  - page GDRGAnonymizeSetup
  - page GDRGAnonymizeFieldList
  - page GDRGFieldLookup
  - page GDRGEnvCopyLogList
  - page GDRGEnvCopyLogLines
  - page GDRGCleanupSetup
  - page GDRGCompanyFeatureSetup
  - permissionset GDRGEnvCleanup
systems:
  - administration
  - development
  - platform
versions_mentioned: []
preview:
  embeddable: true
  frame_url: https://gerardorenteria.blog/2026/08/20/%f0%9f%a7%b9-cleaning-and-anonymizing-copies-in-business-central-environments-companies-and-traceability/embed/
  image: https://i0.wp.com/gerardorenteria.blog/wp-content/uploads/2026/08/designer-1.png?fit=1200%2C1200&ssl=1
  image_alt: null
  image_w: 1200
  image_h: 1200
  site_name: Gerardo Rentería Blog
  favicon: https://gerardorenteria.blog/wp-content/uploads/2020/11/cropped-wolficon.jpg?w=32
  probed_at: "2026-10-07T11:50:14.063Z"
---

# 🧹 Cleaning and anonymizing copies in Business Central: environments, companies, and traceability

[Read the post](https://gerardorenteria.blog/2026/08/20/%f0%9f%a7%b9-cleaning-and-anonymizing-copies-in-business-central-environments-companies-and-traceability/) · Gerardo Renteria (Gerardo Renteria) · 2026-08-20 · 2789 words · tier community · reviewed (checked by Opus)

> A reusable solution for automatically anonymizing sensitive data, marking copied companies, and adjusting settings when copying Business Central environments or companies. It provides table and field configuration, manual or event-triggered execution, and comprehensive logging for audit trails.

## Key points

- Configure which tables and fields to anonymize using setup tables, with options to anonymize selectively across copies
- Leverage standard events (OnClearDatabaseConfig, OnClearCompanyConfig, OnAfterCreatedNewCompanyByCopyCompany) to run cleanup automatically or manually
- Mark copied companies visually with [COPY] tag and adjust configuration settings to distinguish test copies from production
- Log all cleanup executions with header and detail records showing trigger type, company, start/end times, duration, and individual step results for traceability and audit

## Quotes

- "An important part of this idea is not only executing the process, but also leaving evidence of the whole process." (Emphasizes the value of comprehensive logging and traceability for audit, support, and operational review)

## AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

- table "GDRGAnonymizeSetup"
- table "GDRGAnonymizeFieldSetup"
- table "GDRGCleanupSetup"
- table "GDRGCompanyFeatureSetup"
- table "GDRGEnvCopyLog"
- table "GDRGEnvCopyLogLine"
- codeunit "GDRGEnvCleanupMgt"
- codeunit "GDRGEnvCleanupSubscriber"
- codeunit "GDRGDataAnonymizer"
- codeunit "GDRGCompanyMarker"
- codeunit "GDRGPseudonymizer"
- codeunit "GDRGSetupProposalMgt"
- codeunit "GDRGCopyCompanySubscriber"
- codeunit "GDRGCompanyFeatureAdjuster"
- enum "GDRGCleanupOperation"
- page "GDRGAnonymizeSetup"
- page "GDRGAnonymizeFieldList"
- page "GDRGFieldLookup"
- page "GDRGEnvCopyLogList"
- page "GDRGEnvCopyLogLines"
- page "GDRGCleanupSetup"
- page "GDRGCompanyFeatureSetup"
- permissionset "GDRGEnvCleanup"

Not found in BC28-30: table "GDRGAnonymizeSetup", table "GDRGAnonymizeFieldSetup", table "GDRGCleanupSetup", table "GDRGCompanyFeatureSetup", table "GDRGEnvCopyLog", table "GDRGEnvCopyLogLine", codeunit "GDRGEnvCleanupMgt", codeunit "GDRGEnvCleanupSubscriber", codeunit "GDRGDataAnonymizer", codeunit "GDRGCompanyMarker", codeunit "GDRGPseudonymizer", codeunit "GDRGSetupProposalMgt", codeunit "GDRGCopyCompanySubscriber", codeunit "GDRGCompanyFeatureAdjuster", enum "GDRGCleanupOperation", page "GDRGAnonymizeSetup", page "GDRGAnonymizeFieldList", page "GDRGFieldLookup", page "GDRGEnvCopyLogList", page "GDRGEnvCopyLogLines", page "GDRGCleanupSetup", page "GDRGCompanyFeatureSetup", permissionset "GDRGEnvCleanup".

## Context

- Features: data anonymization by table and field, environment copy cleanup, company copy cleanup, manual cleanup execution, event-based automatic cleanup, company visual marking, configuration adjustment, cleanup execution logging

Source: Gerardo Renteria, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
