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:
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.
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.