Okay… this is silly, but it appeared to work for me:
I used an event to pre-format my filter. This is what @jbooker mentioned here:
What I found was that using the .replaceAll("'", "''") was causing App Studio to inject backslashes into the actual string value being passed, as also previously noted in the above chain.
So, I tried to circumvent that and went with replacing CharCodes instead:
"{TransView.MyTest}" .replaceAll(String.fromCharCode(39), String.fromCharCode(39) + String.fromCharCode(39))
.replaceAll(String.fromCharCode(92), "")
… this seemed to work to prevent the backslashes. CharCode(39) for single quotes. CharCode(92) at the end to eliminate any generated backslashes.
I was successfully getting a test value of Bonk''s (my test case, ignore the silly name). However, it seemed like the Execute BAQ was escaping this and still passing a value of Bonk's in my Where Clause, which failed.
I found I had to DOUBLE escape… I needed a value of Bonk''''s in order for it to work.
That way, the Execute BAQ escaped once (using a value of Bonk''s)… and I’m assuming SQL escaped again and finally used a value of Bonk's.
Anyway… I had an event to take my user input of Bonk's… and row-update that into a TransView.MyFilter field with the following expression:
"{TransView.MyTest}" .replaceAll(String.fromCharCode(39), String.fromCharCode(39) + String.fromCharCode(39) + String.fromCharCode(39) + String.fromCharCode(39)) .replaceAll(String.fromCharCode(92), "")
The KEY was actually just replacing the backslashes. I tested the below as well (going back to replacing actual " ’ ") it also worked (and is much cleaner):
"{TransView.MyTest}" .replaceAll("'", "''''") .replaceAll(String.fromCharCode(92), "")
Either of the above replaces the single quote with (4) single quotes… and then eliminates backslashes.
I then was able to set my BAQ Option Where Clause to:
Vendor_Name LIKE '%?{TransView.MyFilter}%'
Grid filtered successfully.