If you want it for something as "you are on xxx record from yyyy" it is not possible to made it without impact to performance in DB systems. It is why the scrollbar on table is not showing "real" position and proportions to table size. Only after you go through whole table it is ok - because to know, where you are, you must go through the records and count.... and it is big data flow...
I created a very small example to show you how this is done. It is almost without performance impact, but requires table changes.
This will be uploaded to the site named something like "CurrentIndex.fob".
It is a very small example created in a few minutes, so I hope you understand the functionality.
Comments
There is no such function. Records are not numbered. You can identify any record with its primary key.
If I understand you correctly, record number is 1 for first inserted records, 2 for second, ...
Just for fun; If your answer is yes, you could get this by setting a filter on primary key with:
TmpRec.SETRANGE( PKField, '', CurrentRecord.PKField )
Then TmpRec.COUNT would give you record number of current record. But please don't do this This number will change if you insert or delete records.
If I missunderstood you, could you explain what you want to achieve? Why do you need record number?
Documentation for Microsoft Navision
E/R diagrams, Workflow diagrams, UML diagrams, process diagrams
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
This will be uploaded to the site named something like "CurrentIndex.fob".
It is a very small example created in a few minutes, so I hope you understand the functionality.
Documentation for Microsoft Navision
E/R diagrams, Workflow diagrams, UML diagrams, process diagrams
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
The sample is available for download now.
I looked at your code for the second time.
You could add some comments, but that would be against Navision Coding Standards
I think this code works well if you are just adding records. When you insert them RecordCount would not have sequential number?
Have you noticed, that Nicole never replied to everything writen in this topic? We might be missing her true requirements. Nicole, where are you?
Documentation for Microsoft Navision
E/R diagrams, Workflow diagrams, UML diagrams, process diagrams