mibuso.com

Microsoft Business Solutions online community
It is currently Sat May 25, 2013 6:23 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: How to know the current record number
PostPosted: Wed Dec 01, 2004 9:17 am 
Offline

Joined: Thu Sep 09, 2004 6:07 pm
Posts: 13
Location: Manila
Country: Philippines (ph)
Please help. What function can I use to know the current record number?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 01, 2004 3:56 pm 
Offline

Joined: Thu Nov 18, 2004 12:35 pm
Posts: 87
Location: Slovenia
Hi,

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 :cry: 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?

_________________
http://www.NaviTools.com
Documentation for Microsoft Navision
E/R diagrams, Workflow diagrams, UML diagrams, process diagrams


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Fri Dec 03, 2004 9:48 am 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Thu Oct 16, 2003 8:50 am
Posts: 12265
Location: Brno
Country: Czech Republic (cz)
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...


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Fri Dec 03, 2004 9:33 pm 
Offline

Joined: Thu Jul 20, 2000 7:01 am
Posts: 121
Location: Vejle
Country: Denmark (dk)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 04, 2004 2:09 pm 
Offline

Joined: Thu Nov 18, 2004 12:35 pm
Posts: 87
Location: Slovenia
Are you looking for unique RowID like other SQL databases have?

_________________
http://www.NaviTools.com
Documentation for Microsoft Navision
E/R diagrams, Workflow diagrams, UML diagrams, process diagrams


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Sat Dec 04, 2004 10:49 pm 
Offline

Joined: Sun May 02, 2004 2:29 pm
Posts: 466
Location: Stäfa, Switzerland
Country: Switzerland (ch)
We have all gone through a challenge to program this "Access" feature. If it is a small code, maybe you can copy/paste it here? Or at least the idea?

_________________
           ®obi           
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Sun Dec 05, 2004 11:45 pm 
Offline

Joined: Thu Jul 20, 2000 7:01 am
Posts: 121
Location: Vejle
Country: Denmark (dk)
The example was uploaded seconds after my note above was written, so please have patience. Maybe mr. Van Dyck is on weekend...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 11:01 am 
Offline
Site Admin
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Sun Nov 07, 1999 8:01 am
Posts: 3294
Location: Wilrijk
Country: Belgium (be)
Actually, I went to Aachen (Germany) to do some Christmas shopping. \:D/
The sample is available for download now.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 09, 2004 10:06 pm 
Offline

Joined: Thu Jul 20, 2000 7:01 am
Posts: 121
Location: Vejle
Country: Denmark (dk)
Now 148 downloads and no comments! Did nobody manage to get it working, or isn't it understandable?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 7:12 am 
Offline

Joined: Thu Jul 20, 2000 7:01 am
Posts: 121
Location: Vejle
Country: Denmark (dk)
Now 210 downloads and still no comments! :?:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 12:24 pm 
Offline

Joined: Thu Nov 18, 2004 12:35 pm
Posts: 87
Location: Slovenia
Hi PrebenRasmussen,

I looked at your code for the second time.

You could add some comments, but that would be against Navision Coding Standards :wink:

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?

_________________
http://www.NaviTools.com
Documentation for Microsoft Navision
E/R diagrams, Workflow diagrams, UML diagrams, process diagrams


Top
 Profile E-mail WWW  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: