0

I've been trying to filter a datawindow by using the argument product_id = 'Z108-20-6,3~10' and company_id = 14, but the setFilter function returns -1, which is invalid.

After looking at the docs and some Google search, I've found that the tilde character is an escape character, so, in order to use it as a literal character, I should be using "~~" instead of "~". Using two tildes in the filter argument does change the return value, but doesn't apply the filter correctly (it keeps showing no rows).

How can I SetFilter a datawindow by using a tilde in the filter expression? I`m using PB 12.5.

ramon
  • 23
  • 2

1 Answers1

1

Not sure if this will fix your issue but something to try.

From the PB help for the SetFilter method.

The escape keyword designates any character as an escape character (do not use a character that is part of the string you want to match). In the following example, the asterisk (*) character is inserted before the _ character and designated as an escape character, so that the _ character is treated as part of the string to be matched:

comment like ~'%o_a15progress%~' escape ~'~'

Matt Balent
  • 2,337
  • 2
  • 20
  • 23