Form keeps last selected Record after SETFILER

I am using Navision 2.01. I have a Form with a TableBox (as per the form creation wizard) and I have added a Textbox to the top of the form… The Text Box has the following CAL code: //OnAfterInput(Text) { IF Text <> ‘’ THEN SETFILTER(“No.”,’=%1’,Text) ELSE SETFILTER(“No.”,’’); //} And has a sorce expression pointing to “FilterPartNo” text, a CAL Global and a Table Relation with “Item”.“No.” When you Run the form and select a Partnumber in the TextBox it Filters the data in the TableBox - which is exactly what I want … Except that it hangs on to the last selected Record… Ie. if the current selected record is ‘123’ and you type ‘402*’ in the TextBox then the TableBox will list three records ‘123’, ‘402’ and ‘402.ace’ until you select the ‘402’ or ‘402.ace’ record and then reselect the ‘123’ record, then the ‘123’ record will be filtered and will disapare leaving the correct results… [:(!] Does anyone have any clue how to stop this occuring?? Regards, Jeremy A

Hi, Please write the code CurrForm.UPDATE(FALSE); in the OnAfterValidate event of Text box.It will solve your problem.

Thanks a heap! I had tried adding CurrForm.UPDATE() to the OnAfterInput Trigger which returned an error… ?Due to the fact that the Data hasn’t been validated the form can’t update?.. is my thinking correct? That’s the thing that I find the hardest about CAL, figuring out where to stick the code to make it work! Thanks, Jeremy A

Hi, You have written the code in wrong event. Please write CurrForm.UPDATE(FALSE) in OnAfterValidate trigger(event) not in OnAfterInput trigger(event).