find record with case insensitivity key

Questions and answers for designing and implementing forms in Servoy

find record with case insensitivity key

Postby nandlalajisingh » Fri Jul 04, 2014 9:35 am

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
nandlalajisingh
 
Posts: 15
Joined: Thu Jun 05, 2014 9:14 am

Re: find record with case insensitivity key

Postby boonstrj » Fri Jul 04, 2014 12:06 pm

I think the '#' must be the first character, so try #%key% instead.
Jeroen Boonstra
2Serve-IT

Servoy version 5.2.13/6.1.x/7.1.0
boonstrj
 
Posts: 63
Joined: Mon Jan 07, 2008 11:49 am
Location: Netherlands

Re: find record with case insensitivity key

Postby sovanm » Fri Jul 04, 2014 3:02 pm

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
sovanm
 
Posts: 99
Joined: Fri Oct 28, 2011 1:55 pm
Location: Bhubaneswar, India

Re: find record with case insensitivity key

Postby jasantana » Sun Jul 06, 2014 6:35 pm

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.
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.uk
Servoy MVP 2015
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 555
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: find record with case insensitivity key

Postby nandlalajisingh » Mon Jul 07, 2014 12:10 pm

Thanks all. its working now.

@jasantana - thanks for adding extra point on it. its really helpful for me.
nandlalajisingh
 
Posts: 15
Joined: Thu Jun 05, 2014 9:14 am


Return to Forms

Who is online

Users browsing this forum: Google [Bot] and 6 guests