4xjbh:
Thanks, helps alot. Do I need to convert the integer (project_number) to a string to do a wildcard search?
Hmm…I think you better use SQL then to perform the search. Since you need to cast the values in the database (thus the field) to be able to use wildcards. I don’t think you can otherwise use wildcards in integer data.
Pseudo SQL:
SELECT id FROM myTable WHERE cast(project_id, 'string') LIKE '%23456%' OR projectname LIKE '%23456%'
Depending on the database brand you need to change the cast function (I assume you use MSSQL or Sybase since you mentioned ‘convert’).
This SQL you can then use to load the foundset like so:
var _sQuery = "SELECT id FROM myTable WHERE cast(project_id, 'string') LIKE ? OR projectname LIKE ?"; // pseudo sql
var _sArg = "%" + globals.mySearchVar + "%";
controller.loadRecords(_sQuery, [_sArg, _sArg]);