Search problem

I’ve added a method to onFocusLost to the field globals.gname. It should test whether the name entered already exists in the security table and if it does, if the record found has a value other than 0 or empty or null in the seven_id field, an integer field..

I suspect the solution needs something along these lines

controller.find(); 
user_name_lc = globals.gname.toLowerCase(); 
var recordCount = controller.search();
// then a search within the found set for 0, empty or null

What’s the syntax for a search within a found set? (Page 38 of the documentation says only “controller.search(false,false);” which isn’t sufficiently enlightening.) Any special considerations in searching for a field which could be null, 0 of have a value greater than 0?

The following does NOT work.

controller.find(); 
user_name_lc = globals.gname.toLowerCase(); 
seven_id = 0; // doesn't work with seven_id = ''; either.
var recordCount = controller.search();

Much appreciation.

What’s the syntax for a search within a found set?

In the online documentation there is this:

Function
search()
Description
Performs a search;

includes optional arguments for clearing the last result; and reducing/extending the search criteria.
Syntax
controller.search([clearLastResults,reduceSearch])
Parameters
clearLastResults - true, false
reduceSearch - true, false

Example //extends the current foundset
controller.search(false,false);

Thanks, that got it.

For the record in this case I needed controller.search(false,true);

john.allen:

What’s the syntax for a search within a found set?

In the online documentation there is this:

Function
search()
Description
Performs a search;

includes optional arguments for clearing the last result; and reducing/extending the search criteria.
Syntax
controller.search([clearLastResults,reduceSearch])
Parameters
clearLastResults - true, false
reduceSearch - true, false

Example //extends the current foundset
controller.search(false,false);

Online documentation (F1 or Help) for any release of Servoy will match
exactly the printed documentation and the corresponding pdf file. The
difference is that for the printed books and their respective pdf files, we
separate the documentation into Servoy Developer Edition Volume 1:
User’s Guide and Servoy Developer Edition Volume 2: Reference Guide.

If you are looking for information or an example of a Servoy function or
runtime property, you should refer to the Servoy Developer Edition
Volume 2: Reference Guide. For example, the search() function
description and detail can be found on page 153.


Marc Norman
Servoy