Hello, friends!
I've made a form which shows records from a table, after filtering them for a field. When the value of that field changes in a record, the form won't show it any more.
My problem is that when there is only one record that gets into the filter of the form and I change the value of the field that determines the filter, suddenly appears the no. series form, and asks me to select a numeration series.
I think it happens because the form tries to open a record that fits into the filter. If there isn't any record, the form attempts to create a new one, and then it asks for the no. series.
My customer doesn't want that it happens, and I've tried many things: I tried to place a CurrForm.CLOSE in the OnAfterValidate of the field, but it didn't work. I put CurrForm.CLOSE in On Validate, but the sistem told me that i can't run that order in that trigger. I used DelayedInsert property, but it causes more problems.
If any of you could help me, I'd be grateful
Thanks in advance
Best Regards,
Manuel Barral Paul
0
Comments
on the primary key field(s) in the OnAfterGetRecord-Trigger to clear the filters from the link. Is this missing ?
It was missing really. But now, I've created the setrange and the no. series form keep appearing, so I'm afraid it doesn't solve the problem.
Really, the form tries to insert a new record, because the code that makes the no. series form appear is in the OnInsert trigger.
Manuel Barral Paul
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I finally solved the issue placing an error in the OnNewRecord trigger of the form. A function turns true a boolean variable, and if this variable is true, I've inserted an error message (withou message in this case). If you put code wuth an error in the OnNewRecord trigger, form will be closed, and it's true!
Thank you for your help.
Manuel Barral Paul