How to set a language-neutral filter ?
navvy
Member Posts: 79
Hi,
I'm trying to find all records in the table 5054 "Contact Business Relation" with "Customer" on the field "Link to Table". The "Data Type" of this field is "Option": filter.jpg
When I set a filter like....
Is it possible to set set a language-neutral filter ?
I'm trying to find all records in the table 5054 "Contact Business Relation" with "Customer" on the field "Link to Table". The "Data Type" of this field is "Option": filter.jpg
When I set a filter like....
ContactBusinessRelation.SETFILTER("Link to Table", 'Customer');
.... it works fine if the language in NAV is set to English. If the language in the NAV Client is set to another language, it's not working ](*,)Is it possible to set set a language-neutral filter ?
navvy
Freelance Developer
Freelance Developer
0
Answers
-
Yes, it is possible.
You should write your code like this:ContBusRelation.setfilter("Link To Table",'%1',ContBusRelation."Link To Table"::"Customer");
The way you have written the code, you are trying to do an implicit conversion between a type of string to a type of option. The way the implicit conversion is handled varies depending on your language setting.
If you use the NAV representation of the value you don't have a problem.0 -
It works, cool, thank you

But how does it works ? #-o The implicit conversion is clear, but what's the meaning of :: between "Link to Table"::Customer ?navvy
Freelance Developer0 -
:: is used for option-fields.
Another example:
Status is an option-field with 2 options Open and Released.
IF Status = Status::Released THEN...
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
Could you put [Solved] in the title?0
-
ok, that's clear. Last question: If I use the :: for option-fields, in which language must the option-value (for example: "Released" or "Customer") be defined ?navvy
Freelance Developer0 -
As long as the optionstring ML property has been set, you can define the option string for many different languages.
Than whatever language you have set the application in will compile if have the right optionstring for that language entered in C/AL.
However, when you look at the code the next time you open it, I believe your code will be in the default Language.0 -
girish.joshi, thanks for the explanation, now I understand how it works. 8)navvy
Freelance Developer0 -
girish.joshi wrote:As long as the optionstring ML property has been set, you can define the option string for many different languages.
Than whatever language you have set the application in will compile if have the right optionstring for that language entered in C/AL.
However, when you look at the code the next time you open it, I believe your code will be in the default Language.
What you are entering in the code is what is in the "OptionString" which is not language depending. Just the captions, which are used in the user interface depends on the language.0 -
But an OptionStringML (Multilanguage) exist ?navvy
Freelance Developer0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

