Page 1 of 1

find record with case insensitivity key

PostPosted: Fri Jul 04, 2014 9:35 am
by nandlalajisingh
Hi All,
i am new to servoy. i am trying to find record using foundset.search(). By using %key% i am able to get record but when using %#key%, i am not able to get any record.
code:
if(resultFoundset.find()) {
for(var index = 0; index < fieldList.length; index++) {
resultFoundset[fieldList[index]] = '%#'+valueList[index]+ '%';
}
resultFoundset.search();
}
where fieldList and valueList are array where i am storing value

Thanks in Advance

Re: find record with case insensitivity key

PostPosted: Fri Jul 04, 2014 12:06 pm
by boonstrj
I think the '#' must be the first character, so try #%key% instead.

Re: find record with case insensitivity key

PostPosted: Fri Jul 04, 2014 3:02 pm
by sovanm
Hi Nanadlalji,

Welcome to the servoy community...:)

For case insensitive searching you can use '#' in front of the value you are searching for.
Please follow this link for more information on the special characters in find-search mode.

Thanks

Re: find record with case insensitivity key

PostPosted: Sun Jul 06, 2014 6:35 pm
by jasantana
Hi, you should also notice that your code is doing an AND search. If you want to do an OR you must add a resultFoundset.newRecord() per field.

Re: find record with case insensitivity key

PostPosted: Mon Jul 07, 2014 12:10 pm
by nandlalajisingh
Thanks all. its working now.

@jasantana - thanks for adding extra point on it. its really helpful for me.