Table relation

tompynation
Member Posts: 398
Hi,
When you go to the properties of textbox on a form you have to possibility to add a table relation...
"Product Group".Code WHERE (Item Category Code=FILTER(GV_ARTICLECATEGORY))
Is it possible that this table relation refers gets filtered by a global variable?
The bold is my global variable, but when i try to use the lookup now on the form i got following error:
A value in the filter 'GV_ARTICLECATEGORY' in the Item Category Code field in the Product Group table is too long for the field type.
Type: Code10
My global variable used in the filter is a code of length 10... but it isnt using the value of the Global Variable. It's just trying to use the name of the global variable
When you go to the properties of textbox on a form you have to possibility to add a table relation...
"Product Group".Code WHERE (Item Category Code=FILTER(GV_ARTICLECATEGORY))
Is it possible that this table relation refers gets filtered by a global variable?
The bold is my global variable, but when i try to use the lookup now on the form i got following error:
A value in the filter 'GV_ARTICLECATEGORY' in the Item Category Code field in the Product Group table is too long for the field type.
Type: Code10
My global variable used in the filter is a code of length 10... but it isnt using the value of the Global Variable. It's just trying to use the name of the global variable
0
Answers
-
If you want to use your variable then you'll need to do it by code in the OnLookup trigger...0
-
Unfortunately, in a table relationship you can't define a filter with a global variable, only on the value of another field, or a constant.
Table relationships should not be define on a form level anyway, and lookup code should also not be programmed on the form, unless it is a situation that is unique for that particular form. Generally speaking, when you define a table relationship, it is on a table level, and the same relationship should exist on every form for that table. If you define the relationship on form 1, then form 2 will not have the same relationship, and you can have bad results. now if the relationship is set on a table level, it will behave the same way on every form, without having to change any of them.
What is important to know, is that as soon as you add any local variables, or any C/AL code (even comment lines, even a blank line with nothing on it) in the assistedit or lookup triggers on the form, that breaks the relationship set in the table.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 320 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