NAV 2013 R2. Filter in table and in SubPage
delaghetto
Member Posts: 89
Hello!
Please help me solve this situation:
- I have a custom table called "header"
- I have another custom table called "lines" where there is a Field "ItemID".
- I have a Page called "HeaderPage"
- I have another Page called "HeaderLines1" (Type ListPart)
- I have another Page called "HeaderLines2" (Type ListPart)
In the Header page, I have HeaderLines1 and HeaderLines2 as a subpages. Now, the ItemID filter is different in HeaderLines1 and HeaderLines2. So in each subpage, I go to the ItemID field and put the filter in the TableRelation property.
The problem is that I can put any value, like 'blablabla' in the field, and it doesn't do any validation to see if the Item exists.
If I put the filter in the TableRelation property of the "Lines" table, the filters in the subpages are ignored.
¿How can I correctly do this? Having 2 subpages with the same table as datasource and different filters?
Thanks.
Please help me solve this situation:
- I have a custom table called "header"
- I have another custom table called "lines" where there is a Field "ItemID".
- I have a Page called "HeaderPage"
- I have another Page called "HeaderLines1" (Type ListPart)
- I have another Page called "HeaderLines2" (Type ListPart)
In the Header page, I have HeaderLines1 and HeaderLines2 as a subpages. Now, the ItemID filter is different in HeaderLines1 and HeaderLines2. So in each subpage, I go to the ItemID field and put the filter in the TableRelation property.
The problem is that I can put any value, like 'blablabla' in the field, and it doesn't do any validation to see if the Item exists.
If I put the filter in the TableRelation property of the "Lines" table, the filters in the subpages are ignored.
¿How can I correctly do this? Having 2 subpages with the same table as datasource and different filters?
Thanks.
0
Comments
-
I think you need to call in a senior resource for some help here on understanding concepts. The TableRelation property is a field-level property used to drive lookups and data validation...it has nothing to do with the filters used to determine what data shows on subpages. It's also incredibly rare that you would define a TableRelation on a field at the page level (apart from a variable on a request page)...as a general rule it should always be used at a table level.
You need to use the subpageview/subpagelink properties on the header page to restrict the data shown on the subpages...or code in each subpage (or the header page) to dynamically apply filters if there's more logic involved.
My big recommendation is still to spend some time with an experienced resource here...hearing that you're trying to use the TableRelation property to apply filters has me thinking you'll just play around with settings in the other properties until you get it (somehow) working. You can create some ugly solutions if you don't fully understand what exactly you're doing.Rob Hansen
http://www.epimatic.com0 -
OK, I agree that it's best to have the TableRelation at the table level and not in the subpages, so in my ItemID field in the lines table I put the relation.
The thing is that if I use the subpageview/subpagelink, I can only filter by "Item No." I cant filter for example by "Item Group"
¿So how could I filter by "Item Group" in the subpage without using the TableRelation property in the page field? ¿What kind of code I need to put?
The way I'm able to make it work is by putting the TableRelation in the subpage and by Code using "Onvalidate" in the table, I check if the user is putting an invalid Item by hand.
I hope there is a better way of doing this.0
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