I have a problem with a filter in the table SETFILTER doesn’t work. I can’t filter the records when it contains “&” How can I solve this problem? Thank you
Even worse, try to set a filter on the field “Email” using the “@”. Huuuaaaaaa… but that is Navision
I think that there is more to this problem than simply applying a filter looking for &. Imagine that you have a process that uses for example the primary key of the Item table to filter entries in item ledger table. If the item number contains a reserved symbol like & then the process fails. Its a real pain having to program to prevent the use of reserved filter symbols in table fields when it should be handled by Navision.
Harikesh… your solution will just show the records where Description = & not the ones where the description contains the simbol & Regards
SETFILTER(Description,’ ’ ‘&’ ’ '); ** Note that is three single quotes on either side, not double quotes The ’ ’ next to the * is converted to ’ when it runs. Basically, putting a single quote on either side of the filter will ensure Navision treats & as a literal. This works fine unless your filter already includes a single quote, in which case you have use two single quotes instead of one.
Regarding @ in mail addresses, If you are searching for a specific address you can use SETFILTER(Description,’=firstname.lastname@example.org’) The = sign ensures the @ is treated as a literal. If you just want to find all entries with a @ in them then I have no idea.
Paul, the trick using ’ around the @ (i.e. SETFILTER(Description, ‘’’@’’’) won’t work? Sigh. Where are the good old days of UNIX, when you could turn each and every magic character in each and every program into an ordinary character by simply preceding it with a \ ?
You’re right, see posting above for treatment of @. I think the @ filter is commonly known as a chocolate fireguard.
Well, not quite. I just tried it (’’’@’’’) and it doesn’t work. [V] Variations using parameters etc. didn’t help either. What’s a “chocolate fireguard” [?]
A “chocolate fireguard” is a British phrase used to denote something that is useless. I hope you can see why. [:p]