Business Issue Filter Issue


Author
Message
Danny Doobay
Danny Doobay
StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)
Group: StrataFrame Users
Posts: 40, Visits: 333

Hello,

When I have to filter BO, this code works fine until First Name has a single quote (For example o'reilly)

CustomerBO.Filter = "FirstName = '" & First_Name & "'"


What is the alternative?


Danny Doobay
Danny Doobay
StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)
Group: StrataFrame Users
Posts: 40, Visits: 333
I found the answer:

First_Name.Trim.Replace("'""''")
replace single quote with two single quote.


Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Danny,

Use the String.Format instead to set your filter condition, it is cleaner and work all the time.

CustomerBO.Filter = String.Format("First_Name = {0}", First_Name)


Edhy Rijo

Edited 10 Years Ago by Edhy Rijo
Danny Doobay
Danny Doobay
StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)
Group: StrataFrame Users
Posts: 40, Visits: 333
Thank you.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search