I developed a new NAVISION report, using my native language (Portuguese). Since the boolean values in Portuguese are reflected in "Sim" and "Não" (Yes and No), in my C/AL there was something like:
SETFILTER(Open, 'Sim');
As you know, this means that I only wanted records with the field "Open" set to true.
When I later changed the NAVISION language to English and then tested the report there was the following error message:
'Sim' is not an option.
The existing options are:
No, Yes
What can I do to solve this problem? Is there a way to find the current language (I could then make an IF statement)?
Regards,
Regards,
Manuel Xavier
0
Comments
Why doesn't SETFILTER accept the argument TRUE but SETRANGE does?
Manuel Xavier
This will work also:
From the C/SIDE Online-help:
e.g.
SETFILTER(MyOption, MyOption::Option) will NOT work, because an option expects an integer-value, and SETFILTER wants a string. So, you have to use SETFILTER(MyOption, '%1', MyOption::Option). Mapped to your problem, when you want to use TRUE or FALSE in a SETFILTER, then you probably have to use SETFILTER(Open, '%1', TRUE);
Off course, using SETRANGE in this case is much more appropriate ... . Just use SETFILTER when you want to apply a more complex filter on a field, like SETFILTER(MyField, '%1..%2', Number1, Number2). Filters like that are not possible with a SETRANGE.
Hope this explenation was satisfactory ... .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
... I wasn't able to erase my previous message either ...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
In your last reply, you wrote "From the C/SIDE Online-help:".
What online help?
Thanks.
Manuel Xavier
One of the processes which uses a supplied tool finds all of the literals in the code. It puts in constants where the literals were and creates the contant definition with the literal. In this way the constant can have multiple languages associated with it whereas a literal (in single quotes) has the actual words of one language. Problem is this process changes these SetFilter literals such as 'Yes' so the next process is to manually put them back!
Anyway, this is just to point out there are some hooks when dealing with multilanguage and the multilanguage document can help avoid them.
Guys,
Am I wrong if I'm telling you to always develop in the ENU (English) language? I think this way you will never have these kinds of problems. Or not?
If it was hard to write, it should be hard to understand."
Emiel you are not wrong.
All development should be in ENU (English US) which will avoid this problem. Then you can add any languages you like to the captions and Text Constants etc...