Is it possible to include special characters, e.g. * or & in a filter string?
Some Customer and Vendor names have these characters and I cannot find them when doing a SETRANGE or SETFILTER in C/AL.
CustNameFilter := '@' + CustName;
recCust.INIT;
recCust.SETFILTER(recCust.Name,CustNameFilter);
Thanks
0
Comments
use SETRANGE. In this case the string is taken as is.
If you use SETFILTER, best is to replace those chars with '?' which means any character. So it is not perfect, but better I didn't find.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Error"The filter "Cert(A)"is not valid.Did not expect a '('"
Filtering question
Note: The @ needs to go to the value parameter, not the FilterString.
Thanks for replying. I coukd not get the SETRANGE to work however replacing the & and * characters with a ? character and using SETFILTER worked perfectly.
Thanks
Did you try my suggestion of using %1 and value parameters with SETFILTER? It has the advantage of being simpler to implement and not creating ambiguities.
yes I used your suggestion and it worked perfectly.
Thanks for your help