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.
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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.
And, are you using some FIND or GET in your code without IF - THEN statement? Yes? It is the place of the error?...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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.
1.) Clear(Rec) for Subform 2
2.) Set Form Property (Save Table View) to No (SubForm 2)
I already tried that, but without result.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I tried that but the debugger didn't stop at all. The error just pops up without any debugger.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.