Page (subform) not filtering properly
mtlmonk
Member Posts: 48
Hi,
I've got a page with a subform in it where I need to pass custom filters, rather than using the SubPageLink property on the page.
However, when inside the subform, I don't see any filter set on Rec variable so the subform just shows all comments found in the table it is linked to.
OrderComment.SETRANGE("Contract No.","No.");
OrderComment.SETFILTER("Change Order No.","Change Order No.");
CurrPage.CommentsSubForm.PAGE.SETTABLEVIEW(OrderComment);
CurrPage.CommentsSubForm.PAGE.UPDATE;
OrderComment is a global variable, not temporary one
It works well under Nav2013R2 but not in 2016
I've got a page with a subform in it where I need to pass custom filters, rather than using the SubPageLink property on the page.
However, when inside the subform, I don't see any filter set on Rec variable so the subform just shows all comments found in the table it is linked to.
OrderComment.SETRANGE("Contract No.","No.");
OrderComment.SETFILTER("Change Order No.","Change Order No.");
CurrPage.CommentsSubForm.PAGE.SETTABLEVIEW(OrderComment);
CurrPage.CommentsSubForm.PAGE.UPDATE;
OrderComment is a global variable, not temporary one
It works well under Nav2013R2 but not in 2016
0
Answers
-
follow https://msdn.microsoft.com/de-de/library/dd355387(v=nav.90).aspx
Remark: SETTABLEVIEW is not supported for setting views on subpages from code on table headers. For example, you cannot set a table view on the SalesOrder subpage from the SalesHeader.best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
What's weird, same code works in 2013R20
-
create a function in subpage with VAR parameter OrderComment, in that function read filter using getfilter(s), set that filter using setfilter(s) to rec.
call that function before subpage.update.best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
Tried that...
function xyz(var ordercomment)
rec.copyfilters(ordercomment);
Didn't work.0
Categories
- All Categories
- 75 General
- 75 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
