Closed Arthurvdv closed 6 months ago
I think this issue has been there since NAV. I can rember that I changed there some filter because of this behaviour. Additionally I think that this is more a plattform issue and less a compiler issue. Therefore this issue will be closed for this reason probably.
I've found my comment on a filter that i created for NAV 2018:
//TempFile.SETFILTER(Filename, '@*%1*.pdf',DocumentNo); -> Isn't working as expected: %1 isn't replaced with the DocumentNo
TempFile.SetFilter(Filename, '@*' + DocumentNo + '*.pdf');
%1 isn't replaced with the DocumentNo
You're right, I have it backwards 🙈 It's not the operator that's becoming a literal character, but the placeholder (%1) isn't replaced.
I'll edit the issue on this, so it becomes more clear.
As pri-kise explained this is standand platform behaviour. Almost every developer stumbles upon it at a time. Unfortunately changing it could be breaking code everybody relies on for decades even though the propability is high, that such code was written in ignorance of the problem.
Additionally I think that this is more a platform issue and less a compiler issue.
I experience this as a "AL Developer Experience Bug", so I though this was a good starting point here :-)
In case this is not the right place, I hope this issue could be transferred (or point me in the right direction).
Unfortunately changing it could be breaking code everybody
If breaking code is the concern, this could be handled with a feature flag on the Feature Management module.
All true what was said above. It is by design. It is legacy. And it is documentation issue. Also a runtime. As far as I know the documentation update is opened for all. It should be updated with the correct behavior.
1. Describe the bug When using a
SetFilter
with one of the operators*
,@
or?
, the behavior of the %1 placeholder changes.2. To Reproduce
In case of A) and C) the placeholder (%1) is replaced with the value 8. In case of B) the %1 isn't replaced, where the filter value is
*%1
instead of becoming*8
.3. Expected behavior Should all three messages return the same value? Not sure of this is a deliberate behavior or an bug. In case the behavior is "by design", it would be great the include this in the documentation (Record.SetFilter(Any, Text [, Any,...]) Method) and maybe elaborate on why this design choice has been made.
4. Actual behavior It seems that the behavior of a placeholder(s) is different on depending on the use of the
*
,@
or?
operators. The other supported operators, <, <=, >, >=, <>, &, .., and | don't influence the behavior of placeholder(s).5. Versions:
Final Checklist
Please remember to do the following:
[x] Search the issue repository to ensure you are reporting a new issue
[x] Reproduce the issue after disabling all extensions except the AL Language extension
[x] Simplify your code around the issue to better isolate the problem