web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / My NAV Notes / View the current timestamp ...

View the current timestamp of a record

Community Member Profile Picture Community Member

Recently I was experimenting with code and made an error by accident. Experimenting with C/AL statements or datatypes makes me understand code and functionality better. I specified by accident RecordRef.FIELD(0). This field number doesn’t exist you think. But it gave me a result:

This code:

RecordRef.OPEN(18);
RecordRef.FINDFIRST;
FieldRef := RecordRef.FIELD(0);
MESSAGE(FORMAT(FieldRef.VALUE));

Results in:

Message in Windows Client

So I started to search for some answers. Quickly found out it was the timestamp of the record! In one of my early Nav days (already six years now) as a consultant I already knew and saw that this was a physical column in SQL for each row in a table.

The physical column timestamp is visible in SQL Server but not in Microsoft Dynamics Nav

Nav uses it for versioning as an internal mechanism so you cannot view the value by default, even if you are running the table directly from the Development Environment. There is another possibility explained by Microsoft by adding a BigInteger field to an Nav table and then select the SQL TimeStamp property:

But the code earlier mentioned accomplishes the same thing without creating an extra field. I thought it was worth sharing so maybe it will be usefull for someone.


This was originally posted here.

Comments

*This post is locked for comments