# Record Navigation

**URL:** <https://forum.servoy.com/t/record-navigation/1518>\
**Category:** Classic Servoy\
**Created:** [March 18, 2004, 3:08pm UTC](https://forum.servoy.com/t/record-navigation/1518 "2004-03-18T15:08:01Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clive\_Sanders](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@Clive\_Sanders](https://forum.servoy.com/u/Clive_Sanders)\
**Post date:** [March 18, 2004, 3:08pm UTC](https://forum.servoy.com/t/record-navigation/1518/1 "2004-03-18T15:08:01Z")

</div>

I have a database consisting of two tables, Names and Adresses. Each table will have approx. 900,000 records.

Searches to be performed will yeald anything upto 80,000 records, and I need a way of providing a quick navigation function. I don’t necessarily need to load all the foundset records (or is that a pre-requisite for record navigation), I just want to be able to go any record within the foundset quickly.

I have tried creating a global for the user to enter a record no., and setting up a method to use the global as a record no. to go to, which works fine for record counts under 200, but not over 200.

MAC OSX 10.3 server, running on an Apple Mac G4, database is in MySQL.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 18, 2004, 3:46pm UTC](https://forum.servoy.com/t/record-navigation/1518/2 "2004-03-18T15:46:30Z")

</div>

There are 3 ways for doing this:

1. search for the record

2. create a relation with the global on the left side and the field you jumping to the right doing a controller.loadRecords(thatRelation) after filling the global

3. looping until you are where you want to be (can be expensive)  
while(controller.recordIndex \< controller.getMaxRecordIndex() && controller.recordIndex \< globals.jump\_id)  
{  
controller.recordIndex = controller.getMaxRecordIndex();  
}  
controller.recordIndex = globals.jump\_id

---

<div class="post-metadata">

**Author:** ![Clive\_Sanders](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@Clive\_Sanders](https://forum.servoy.com/u/Clive_Sanders)\
**Post date:** [March 18, 2004, 4:36pm UTC](https://forum.servoy.com/t/record-navigation/1518/3 "2004-03-18T16:36:40Z")

</div>

Thanks for the response.

1 How would I go about searching for a particular record no (i.e the 1000th record in a found set of say 10,000) without having to go into Find mode.

2 Not quite sure what you are saying here. The global on the left no problem, but given that I am looking for a particular record no within a found set, what do I put on the right, bearing in mind that none of the fields will have relevant record no’s.

3 Tried that, and it’s too expensive.

What I am looking for is something similar to the way FM does it, i.e. after doing a search you get the records found on the left and then one just has to either pull the slider down or type in the record number to jump straight to that record in the found set.

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 18, 2004, 4:55pm UTC](https://forum.servoy.com/t/record-navigation/1518/4 "2004-03-18T16:55:19Z")

</div>

Curious question how do you know what is on the 1000th record? (i.e. why whould you want?)

---

<div class="post-metadata">

**Author:** ![Clive\_Sanders](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@Clive\_Sanders](https://forum.servoy.com/u/Clive_Sanders)\
**Post date:** [March 18, 2004, 5:07pm UTC](https://forum.servoy.com/t/record-navigation/1518/5 "2004-03-18T17:07:19Z")

</div>

The answer is I don’t know what’s in the record. Just browsing records to ensure consistency plus a number of other reasons.

I could use the standard controller, but the 200 limit is a problem

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [March 18, 2004, 10:14pm UTC](https://forum.servoy.com/t/record-navigation/1518/6 "2004-03-18T22:14:31Z")

</div>

i need to ask. why do you need a 80.000 records foundset?  
and why do you then go to the 1000 or what ever?

people will never look at that many records.  
what consistency are they checking?

---

<div class="post-metadata">

**Author:** ![Clive\_Sanders](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@Clive\_Sanders](https://forum.servoy.com/u/Clive_Sanders)\
**Post date:** [March 18, 2004, 10:51pm UTC](https://forum.servoy.com/t/record-navigation/1518/7 "2004-03-18T22:51:00Z")

</div>

I was trying to keep the description as brief as possible. However, it seems I ned to give more detail, so if it’s Ok with you, I will send over more info offline.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [March 19, 2004, 2:54pm UTC](https://forum.servoy.com/t/record-navigation/1518/8 "2004-03-19T14:54:32Z")

</div>

please send it over . and also tell what you are trying to do.

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.servoy.com/u/simon)\
**Post date:** [June 3, 2004, 3:28pm UTC](https://forum.servoy.com/t/record-navigation/1518/9 "2004-06-03T15:28:19Z")

</div>

I would be interested to hear how this discussion ended.

I am also looking to implement a similar FM style controller/slider for browsing over potentially thousands of search results (up to 400,000 records).

Some of the technicians in our lab like to scroll over large sections of stocks for various reasons (mainly because they are used to FM and fear change!!! ![:evil:]( "Evil or Very Mad")). I am currently considering replacing our FM database with a servoy - mysql implementation, and have been instructed that this is one of the requirements of any new interface we put in place.

Any instructions on getting this working would be greatly appreciated.

Thanks  
Simon

[servoydump.txt](https://forum.servoy.com/uploads/short-url/tJpHIDgbm05Pz84ymp9qiZrYeNI.txt) (302 KB)

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [June 3, 2004, 4:54pm UTC](https://forum.servoy.com/t/record-navigation/1518/10 "2004-06-03T16:54:10Z")

</div>

you can scroll just fine over 1000+ records  
they will be loaded in chunks of 200 when you hit the then current maxFoundSet index.

if you want to scroll to record 1500 (i still have no clue why you would do that) then you can do that in javascript pretty easy

var wantedIndex = 1500;  
do  
{  
var current = controller.getMaxRecordIndex();  
controller.recordIndex = current;  
}  
while(controller.getMaxRecordIndex() \<wantedIndex &&  
controller.getMaxRecordIndex() \> current)  
controller.recordIndex = wantedIndex;

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.servoy.com/u/simon)\
**Post date:** [June 4, 2004, 1:56pm UTC](https://forum.servoy.com/t/record-navigation/1518/11 "2004-06-04T13:56:29Z")

</div>

Thanks for that, I think I have convinced the technicians that they dont need the ability to scroll the entire database anymore! ![:D]( "Very Happy") . Like I said, it was just a tool available in File Maker, that they requested in the new interface.

I am having a little trouble getting a custom JSlider working. Would it be possible to see some of the code that is used to get the slider working for the default controller?

Do you have any plans for a Servoy workshop in the UK this year?

Simon

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [June 4, 2004, 2:05pm UTC](https://forum.servoy.com/t/record-navigation/1518/12 "2004-06-04T14:05:57Z")

</div>

the default controller is a pure java implementation.  
I didn’t use the jslider yet as a bean in javascript.. so i can’t help you with that one right now.

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.servoy.com/u/simon)\
**Post date:** [June 8, 2004, 3:30pm UTC](https://forum.servoy.com/t/record-navigation/1518/13 "2004-06-08T15:30:02Z")

</div>

How do I get the total number of records in a foundset?  
Is there a single method to get this?

Also, could anyone give me some general pointers on how I could set up a method for updating a single field in every record in a foundset?

Any help would be great.

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [June 8, 2004, 6:25pm UTC](https://forum.servoy.com/t/record-navigation/1518/14 "2004-06-08T18:25:24Z")

</div>

try to move sample on databaseManager.getFoundSetCount(…)

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [June 8, 2004, 7:54pm UTC](https://forum.servoy.com/t/record-navigation/1518/15 "2004-06-08T19:54:32Z")

</div>

As for the Update of a single field in every record in a foundset: See the FoundSetUpdater functions under the DatabaseManager… And search the forum, since there have been a couple discussions going on how to get it to work.

Paul

[test\_data.backup.txt](https://forum.servoy.com/uploads/short-url/284cWfQUDqbPcxFWyOzR9pA3jlw.txt) (93.7 KB)

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.servoy.com/u/simon)\
**Post date:** [June 9, 2004, 2:14pm UTC](https://forum.servoy.com/t/record-navigation/1518/16 "2004-06-09T14:14:01Z")

</div>

Thanks for the response.

As I am a novice with servoy, im not sure if what Im doing is correct. I am storing the getfoundsetcount in a global variable, which is displayed in a field on my navigation form.

The variable is set when onShow is executed on the form, and it displays the correct value of the initial foundset.  
Now, if I issue the default find to search a field, the global variable is not updated in the results, because the method to calculate it isnt called again. How can I get the display of the foundsetcount updated automatically after a simple find is executed?

Do I need to write my own find method? Or is there a much simpler way to do this?

Sorry for the simple questions, hopefully I can get the hang of this soon…

Simon

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.servoy.com/u/simon)\
**Post date:** [June 11, 2004, 1:18pm UTC](https://forum.servoy.com/t/record-navigation/1518/17 "2004-06-11T13:18:44Z")

</div>

OK, I sorted the above issue myself.

I have my own method executed onFind, I want to include in the method the ability to search colums based on the text entered into the dataproviders in my form (like how the default onFind does it). How do I get the data out of the fields in find mode?

Can I use the onRecordEdit in find mode to store the entered text into a global?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [June 13, 2004, 9:37am UTC](https://forum.servoy.com/t/record-navigation/1518/18 "2004-06-13T09:37:35Z")

</div>

that won’t work.  
in find mode scripts aren’t working. So onRecordSelect will not be executed.

if you work with global input fields you will need to trigger youre own search. So put a search button on the form and when they fill in the globals and press that button you do the search.

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.servoy.com/u/simon)\
**Post date:** [June 14, 2004, 9:16am UTC](https://forum.servoy.com/t/record-navigation/1518/19 "2004-06-14T09:16:43Z")

</div>

Thanks, that was how I did it in the end.

Your help whilst I have been getting to grips with the demo has been very much appreciated. We are currently seriously considering purchasing Servoy and using it within our department.

Cheers for now.  
Simon
