find mode vs programmatic finds

Hi all

In my solution i decided to opt for programmatically finding data for the users (via a search window using globals) as opposed to find mode. This takes away the issue of users having to learn wildcards etc.

I am currently using the following search method (from a FID) as an example:

forms.maintenance_detail.controller.find();

//sets find requests from globals
if (globals.g_search_job);
{
forms.maintenance_detail.job_no = “%” + globals.g_search_job + “%”;
}

//start search and sort
forms.maintenance_detail.controller.search();

//close diaolog
application.closeFormDialog(true);
currentcontroller.showRecords();
globals.g_recdisplay();

I am finding this usually works well however on certain data entered i can see different results using this method as oppposed to servoys find mode.

For example, in my sample data a search using “in service” in the global field results in 553 records returned using the method above. if i search using servoys find mode it returns 555 records, which is correct. very strange!

does my method need correcting or is this something else?

Any help would be appreciated.

See Matt Patrowsky’s RapidSearch video at:

It is well worth the download.

Dean

Hi

Thanks Dean, sorry for the late reply.

This technique is very interesting but doesn’t answer why a find gets a particular foundset via a method and a slightly different foundset using find mode.

You know, I ended up throwing 3 days programming work away and let my users search via servoys find mode using % and # and the rest of it. They prefer this over pop up search windows, which i thought would be simpler for them.

i always find it very interesting as a developer to watch people use/interact with your software!

There should be no difference in your search results between a scripted search and a “find mode” search - they are both performing SQL queries.

The thing you need to check - is if you’re entering exactly the same search manually in find mode as you are in your method.

What are the two records that are different?

Hi Bob

Thanks for your reply and help

My database has a table with 1522 records. if i search using find mode on the “status” field for “in service” records (exact match) i return 576 records found.

Via my original method with a lot of global fields it would return 574 records, I tried stripping out all the unnecesary global fields that were not being used for this search and ran the method again and it returned 576 records. Correct!

i’ll play around with this a while as there may have been one of the globals somehow screwing up the search. I use global search fields for finding data for reports and so far haven’t had a problem. More testing required.

It would be interesting to know from other developers how many let users use servoys find mode vs. pop ups with global search fields and programmatic searches. Maybe my users were just used to FMP’s way of doing it.

A feature request for future versions of servoy would be an application checkbox to enable non-exact searches by default as per FMP maybe?. Let servoy handle the %'s and #'s.

rodneysieb:
It would be interesting to know from other developers how many let users use servoys find mode vs. pop ups with global search fields and programmatic searches. Maybe my users were just used to FMP’s way of doing it.

We are hiding Find mode, if you hit the Find keyboard shortcut we bring up our search window… all searches done vis SQL.

Can i ask why?

Hi Rodney

Like Swingman my solutions take control of the Find shortcut keys and switch focus to a QuickFind field for the most common searches with option to trigger a Detailed Find popup window.

Why? Primarily because it’s more intuitive for users and less training is required. By scripting all finds I can provide buttons for new search and extend/reduce foundset etc so the user never has to learn the commands - all options that are available can be seen on-screen. Also enables search criteria to be captured and re-used if required.

YMMV

Regards

Graham Greensall

Hi Graham

Thanks for your reply, Hope you are well

I agree with you and like you i had programmed these pop up search forms via globals with buttons for find, extend, constrain etc. took me days thinking i would help the user/make it easier for them. In use however my users who were previously very used to FMP’s find mode, very abruptly told me they didn’t like it and preferred find mode even with its % and #'s.

Did you ever give your users an option of find mode? I suppose it comes down to what they are used to and their competency level.

My FMP Conversion is complete enough to be on site in full production use. took me almost 4 months (over 120 forms), thanks for your help along the way.

Hi Rodney

Great to hear that your solution is in full production - happy to have helped a little.

Did you ever give your users an option of find mode?

Sounds a bit radical :)

I guess that I try to ‘sell’ ideas to the management side first on the grounds of data integrity, security, reduced training etc, then persuade the real users that it will make their life easier with fewer keystrokes and less to remember so they can just get on with the job. Currently do not have any solutions using Find Mode - either I’m persuasive or a bit of a bully :?

Regards

Graham Greensall
Worxinfo Ltd

rodneysieb:
Hi Graham

Thanks for your reply, Hope you are well

I agree with you and like you i had programmed these pop up search forms via globals with buttons for find, extend, constrain etc. took me days thinking i would help the user/make it easier for them. In use however my users who were previously very used to FMP’s find mode, very abruptly told me they didn’t like it and preferred find mode even with its % and #'s.

Did you ever give your users an option of find mode? I suppose it comes down to what they are used to and their competency level.

Only if they start crying and stomping their feet :-)
But I don’t like this option (I don’t like it in FileMaker, too)

rodneysieb:
My FMP Conversion is complete enough to be on site in full production use. took me almost 4 months (over 120 forms), thanks for your help along the way.

Send a snapshot: don’t be shy :-)

I’ve created a method so one doesn’t have to keep remembering all the % and # and !. Just pass the method the form, dataprovider, searchtxt and stuff and it will perform your search. Don’t know if this will help you, but here’s the code.

/********************************************************************************

object: globals.scCore_search();

reference: http://www.servoycode.com/forum/index.php/board,28.0.html

parameters: [0] vFormName required string
[1] vDataProvider optional string // default: finds all records
[2] vSearchTxt optional string // default: finds all records
[3] vSearchCriteria optional string // default: contains
contains
does not contain
is
is not
starts with
ends with
[4] vIsCaseSensitive optional boolean // default: false note
// only works if backend is case sensitive
[5] vClearLastResults optional boolean // default: true
[6] vReduceSearch optional boolean // default: false

purpose: perform search on vFormName

********************************************************************************/

var vFormName = arguments[0];
var vDataProvider = arguments[1];
var vSearchTxt = arguments[2];
var vSearchCriteria = arguments[3];
var vIsCaseSensitive = arguments[4];
var vClearLastResults = arguments[5];
var vReduceSearch = arguments[6];
var vSearchCriteriaArray = new Array( 'contains'
,'does not contain'
,'is'
,'is not'
,'starts with'
,'ends with')

if (globals.scCore_isFormValid(vFormName)) {

// find all records?
if (vDataProvider == undefined || vSearchTxt == undefined) {

forms[vFormName].controller.loadAllRecords();
return
}

// check column validity

// set arguments to defaults if needed

// vSearchCriteria
if (globals.scCore_isValueInArrayString(vSearchCriteriaArray, vSearchCriteria) == undefined) {

// set default to contains
vSearchCriteria = 'contains';
}

if (vIsCaseSensitive != true) {

vIsCaseSensitive = false;
}

if (vClearLastResults != false) {

vClearLastResults = true;
}

if (vReduceSearch != true) {

vReduceSearch = false;
}

var vCaseOp = '';

if (vIsCaseSensitive == false) {

vCaseOp = '#';
}

// build search string
var vSearchString = '';

switch (vSearchCriteria) {

case 'does not contain':
vSearchString += '!' + vCaseOp + '%' + vSearchTxt + '%';
break;
case 'is':
vSearchString += vCaseOp + vSearchTxt;
break;
case 'is not':
vSearchString += '!' + vCaseOp + vSearchTxt;
break;
case 'starts with':
vSearchString += vCaseOp + vSearchTxt + '%';
break;
case 'ends with':
vSearchString += vCaseOp + '%' + vSearchTxt;
break;
default:
vSearchString += vCaseOp + '%' + vSearchTxt + '%';
}

// perform search
forms[vFormName].controller.find();
forms[vFormName][vDataProvider] = vSearchString;
forms[vFormName].controller.search(vClearLastResults, vReduceSearch);

} // end form valid check

Hi

Thanks to all that have posted, this will be interesting to see how users cope with find mode. Have left the option to use pop ups if needed in the future.

Some screenshots for you ric, thanks for your interest.

rodneysieb:
Hi

Thanks to all that have posted, this will be interesting to see how users cope with find mode. Have left the option to use pop ups if needed in the future.

Some screenshots for you ric, thanks for your interest.

Nice job: bravo Rodney :-)

I agree, Your solution looks great!

Rodney - VERY NICE. Plus, this clean design should work very well in Web Client as well!