Automatic key selection
Do you know users that search through a lot of records by setting filters without choosing the correct key? I do too! It's a bad experience for the user and it takes a lot of time and it reduce the overall performance of the Navision system.
So why not let the system automatically choose the best key each time the user set's a filter? The catch is that you need to make a few program lines on each form where you want to use this functionality.
A short description of what to do on each form is entered in the Documentation part of the object. The download also includes a txt file of the object. The object is created in a 3.70 environment. The "Best key" function it self is created by the master him selves: Preben Rasmussen - Thanks!
http://www.mibuso.com/dlinfo.asp?FileID=895
Discuss this download here.
Comments
As always you are 'using and tweaking' my code.... nice to see that the GetBestKeyNo was useful!
Do keep up the great coding and submit more of your apps to mibuso.
Sincerely
"Navision Magician"
The problem is that RecordRef.KEYCOUNT only returns the number of Active keys. The RecordRef.KEYINDEX correctly loops through all keys though, but only as many as RecordRef.KEYCOUNT reports.
If any deactivated keys are present in between, the last active keys can't be reached.
As i am new to navision, i was unable use this functionality.
Please tell how and where to write new program lines.
Thx for the info. Moving an inactive key to the last position was my solution. Doesn't rebuild anything.