4D Blog

Home Product Track data changes in your database

Track data changes in your database

October 18, 2023

Product

In this blog post, we’re thrilled to introduce a powerful method to revolutionize how you manage and track changes within your data store. We’ll unveil the concept of a “stamp”, a specialized marker designed to streamline your data modification monitoring and show you how to tailor these stamps to your unique requirements.

 

Data Change Tracking

What is a Stamp

Before diving into the details, let’s clarify what a “stamp” means in this context. Essentially, a “stamp” serves as a marker to track data entity modification, enabling you to maintain a comprehensive record of changes made to your data.

Data change tracking

ENABLE DATA CHANGE TRACKING

You can initiate data change tracking through a straightforward process. Begin by right-clicking on the table or tables you wish to monitor within the structure window. Select the item menu labeled “Enable data change tracking” from there.

Note: this simple action sets in motion the creation of two indispensable components: a “__GlobalStamp” field and a “__DeletedRecords” table. These elements form the foundation for precise and effective tracking and managing data modifications within your data store.

Getting Data change

The .getGlobalStamp() function is a critical tool that empowers users to retrieve the current global modification stamps associated with their data store. These stamps act as indicators of your data’s modification status, providing invaluable insights into changes and updates within your dataset.

Get data change since yesterday’s example.

//1. First we store the current global stamp for a futur usage 
StoreTodayStamp(ds.getGlobalStamp())
//2. Then the next day, we read the stamp that we stored the day before.
var $yesterdayStamp : Integer
$yesterdayStamp := ReadStoredStamp()

//3. Get the list of modified entities in our 'product' table 
//since the stamp stored the previous day.
var $modifiedProd : cs.productSelection
$modifiedProd:=ds.product.query("__GlobalStamp >= :1"; $yesterdayStamp)

In this example, StoreTodayStamp and ReadStoredStamp are project methods you will need to create to store and retrieve a reference stamp.

Get dELETED RECORD INFO SINCE yesterday’s example.

//4. Get info about deleted entities since the stamp stored the previous day.

var $deletedProdInfo : cs.__DeletedRecordsSelection 
$deletedProdInfo:=ds.__DeletedRecords.query("__Stamp >= :1"; $yesterdayStamp)

This feature puts you in the driver’s seat in a world where precise data management is crucial. It provides clear insights into your data’s changes, allowing you to monitor it effectively, just like in the HDI. Moreover, it enables accurate data synchronization, perfect for incremental updates. It is also a more modern way to deal with data synchronization than Replication via SQL. This feature is the key to efficient data control, making managing, monitoring, and tracking changes in your data store easier. Welcome to a smarter approach to data management, with benefits ranging from monitoring to backup and incremental synchronization.

 

Discuss

Tags 21, Programming, v20 R3

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

David Azancot
David Azancot
– 4D for iOS Product Owner – David Azancot joined the 4D Product team as a Product Owner in 2017. He is responsible for writing user stories and translating them into functional specifications. His role also includes ensuring that feature implementations meet customer needs. David holds an MBA in Marketing, Internet, and Mobility from the Institut Léonard de Vinci. He began his career in 2011 at a mobile startup that was later acquired by Madvertise (a mobile marketing group). Passionate about mobile interfaces, he was a natural choice to develop interactive mobile ad formats for the group in 2015. In parallel, David has been developing his own iOS and Android applications since 2012.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy