Resetting filters
            
                
                    Roelof                
                
                    Member Posts: 377                
            
                        
            
                    Hi,
I have a problem with resetting filters.
I created functionality to transfer filters from 1 subform to a second subform on a main form. That works fine except if you go to a next record of the main form. It then still has the previous settings of subform 1.
The OnBeforePutRecord trigger is basically the last trigger before its getting to a next record.
But how can I reset filters.
Note: I used settableview, copy and copyfilters. Make that helps understanding the problem.
Thanks,
Roelof de Jong.
                I have a problem with resetting filters.
I created functionality to transfer filters from 1 subform to a second subform on a main form. That works fine except if you go to a next record of the main form. It then still has the previous settings of subform 1.
The OnBeforePutRecord trigger is basically the last trigger before its getting to a next record.
But how can I reset filters.
Note: I used settableview, copy and copyfilters. Make that helps understanding the problem.
Thanks,
Roelof de Jong.
Roelof de Jonghttp://www.wye.com
0                
            Comments
- 
            Please, specify, what you want to reach... why you are doing this...0
 - 
            Hi,
Well I added functionality to the Service Order form in order to have a link between the Service Item Line and the Service Invoice Line. What I did was adding a second subform to the Service order.
So you have the mainform which is linked to the Serviceheader table. have 2 subforms: Subform1 which is linked to the Service Item Line table and the second subform which is linked to the Service Invoice Line table. I created a 1:N relationship between subform1 and subform2, which wasn't easy. I found some code on MiBuSo which I used and it works really well, except... that I get an error message when I go to a next Service Header record. It seems to be that the previous filtersetting on Subform1 is still active and not reset. It tries, based on that previous filter to find a Service Item Line, which is not there. I need to do a reset before going to a next record (or even when I create a new record, same error).
I figured out that trigger 'OnBeforePutRecord' would be my best bet, but it doesn't have any impact when I put code there to reset. I have the feeling that it has something to do with the property-settings of Subform1. However I tried every possible property setting but with no result.
Any help or suggestions are welcome.
Thanks,
Roelof de Jong.Roelof de Jonghttp://www.wye.com0 - 
            I think, that you must do some init of the filters in OnAfterGetCurrRecord of the main form...
And, are you using some FIND or GET in your code without IF - THEN statement? Yes? It is the place of the error?...0 - 
            Hi Kine,
I wish it was that simple. No, I checked that. And believe me, I double checked every single trigger and to put code to reset filters. Even property settings on the subform itself I double checked but without any result. I just don't have any clue.
Please help.
Thanks,
Roelof.Roelof de Jonghttp://www.wye.com0 - 
            I have 2 suggestions but dunno will it work:
1.) Clear(Rec) for Subform 2
2.) Set Form Property (Save Table View) to No (SubForm 2)0 - 
            
 - 
            
 - 
            Good question, Kine.
I tried that but the debugger didn't stop at all. The error just pops up without any debugger.Roelof de Jonghttp://www.wye.com0 - 
            In this case it is somehwere in the automatic section of C/SIDE... try to remove all properties with Links between the forms and replace them with some C/AL code under your control...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
 - 323 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
 
