'find' a specific record....

Questions, tips and tricks and techniques for scripting in Servoy

Re: 'find' a specific record....

Postby antonio » Sun Jul 19, 2009 12:34 am

All good points, thanks. Let's not call it a rolodex or use an icon that looks like one. My main consideration is that not everyone thinks like computers/programmers. Can we make software that can work for those who think differently? If you've got less than 200 records from a Find/Search which you want to preserve, what efficient code can we use to move the selected index pointer with out reducing the current foundset?

An example - a user wants to find a record for Acme Widget Co. created some time ago but only has a vague idea of the date. They first do a Find for Company = Acme Widgets and see there are several pages of records in list view. From here the options are

- Reduce the search for a specific date. If that's not the right date, they will have to repeat the search for Company, for each date.
- Reduce the search for a date range, entering "01-06-2008...01-07-2008|dd-MM-yyyy". IMHO This really isn't intuitive to your average user who doesn't work in Java. Sure it's possible for users to learn, but that's adapting the user to the software.
- Provide a way to jump to a selected date then look at records around that date.

The iPhone analogy was just there to make the point that a lot of people in the world love to flick through records to find things, even if they've never owned a rolodex. Observe how many people use things like Cover Flow, or flick through records in their Contacts. Agreed that it's not efficient for 20000 records, but it's great for 50-200. Apple put those things there for a reason - they spent vast amounts on focus groups, audience research and other qualitative studies and found that this is how most brains work. It's the difference between good and GREAT!

Hans suggested this - what's the most efficient to do this? (and given these discussions, could "Goto without reducing foundset" ever be considered as a parameter on the Search command.?)

Hans Nieuwenhuis wrote:Maybe you could create a second foundset, do the find / search in that foundset and then use the
primary keys from that foundset to do a selectRecord in the original foundset.
Tony
Servoy 8 - 2022.03 LTS
antonio
 
Posts: 638
Joined: Sun Apr 02, 2006 2:14 am
Location: Australia

Re: 'find' a specific record....

Postby lwjwillemsen » Sun Jul 19, 2009 12:00 pm

I totally agree with Antonio. We are migrating away from Visual Foxpro and with Foxpro we have the command 'seek exprChar' (on an index) that moves the recordpointer to the first (exact) matching record. With the command 'set near on' we can even move to the nearest matching record.

We see at our customers site that users often don't have the exact search-input-criteria. Nice example in the Netherlands is searching on postal code, where postal code is area based and often used in marketing and expedition.

Point is that we can't tell our customers how to search...

I'm very happy with the Servoy-objecttype 'foundset' and would like to see the recordpointer-movement-search enhancement to it !

greetings,
Lambert.
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: 'find' a specific record....

Postby pbakker » Tue Jul 21, 2009 10:14 am

Just create the function yourself:
- Get a new foundset object on the same table,
- do a find/search on the proper criteria,
- retrieve the PK value of the record retrieved
- and the select the record in the main foundset using that PK.

- If the select Record() function returns false, the PK value is not (yet) part of the loaded records in the main foundset.
- Up to you what to do then:
1: trigger the load of the next 200 records in the foundset and try to select the record again, in a loop, untill selectRecord returns true (be carefull: this might load thousands or crecords into memory!)
2: show the user a message of some sort.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: 'find' a specific record....

Postby jcompagner » Mon Aug 03, 2009 11:01 am

Besides pauls solution you can always just build a generic search method your self..

have a global method with 3 arguments like a foundset and a dataprovider string and dataprovider value

then go looping over the records and test if the dataprovider matches the value.
If it does set the selected index and return

Do make some boundaries checks so that you wont be looping and loading in over X number of records.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: 'find' a specific record....

Postby ROCLASI » Tue Aug 03, 2010 6:35 pm

ROCLASI wrote:Same issue with valuelists that people try to populate with thousands of records (BTW Servoy only allows 500 records in a valuelist). It's bad UI to put so many records in a valuelist (like for use in a combobox). Create a listview with a search/filter field that can act as a listpicker for that field. It's a much better UI for large amounts of records. Search instead of browse.

I created a (dynamic) listpicker module. You can find it on ServoyForge.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: 'find' a specific record....

Postby antonio » Tue Aug 03, 2010 7:18 pm

Wonderful contribution, thanks Robert!
Tony
Servoy 8 - 2022.03 LTS
antonio
 
Posts: 638
Joined: Sun Apr 02, 2006 2:14 am
Location: Australia

Re: 'find' a specific record....

Postby ptalbot » Tue Aug 03, 2010 7:26 pm

Yep that's a very nice one, thanks Robert!
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: 'find' a specific record....

Postby ROCLASI » Tue Aug 03, 2010 7:57 pm

Thanks, I am glad you like it :)
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: 'find' a specific record....

Postby ROCLASI » Wed Aug 04, 2010 3:24 pm

I just released version 0.9.1 that adds some new properties and fixes some issues.
See the news page for more info:
http://www.servoyforge.net/news/19
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Previous

Return to Methods

Who is online

Users browsing this forum: No registered users and 7 guests