Each table in Microsoft Dynamics NAV includes a hidden timestamp field.
The timestamp field contains row version numbers for records as maintained in SQL Server.
You can expose the timestamp field in a table, and then write code against it, add filters, and so on, similar to any other field in a table.
However, you cannot write to the timestamp field.
A typical use of the timestamp field is for synchronizing data changes in tables, when you want to identify records that have changed since the last synchronization.
For example, you can read all the records in a table, and then store the highest timestamp value. Later, you can query and retrieve records that have a higher timestamp value than the stored value.
To set up a timestamp field in a table
- In the development environment, open the table, and then add a field of the data type BigInteger.
Specify a name for the field, such as timestamp.
You can specify any valid name for field; you are not restricted to use timestamp.
- Open the field properties, and then set the SQL Timestamp property to Yes.
For demo purpose I am adding this field to table 330 – Currency Exchange Rate
Now when I run the table in RTC I see value automatically populated in this field.
I will come up with more details in my future posts.