CurrForm.UPDATE(FALSE) gives an Error

Hello friends,

I’ve created tabular form and putting filters on it in code.

Like this:


SETRANGE(“Document No.”, 2);

When filter returns several rows, I don’t have any problems, but when filter returns zero rows, I still have one row on the form.

CurrForm.UPDATE(FALSE) gives an Error. It says:

Purchase does not exists.#### Identity fields and values:

Document Type=‘Inquiry’, No.= 2

I use this command in OnAfterValidate() trigger of TextBox with filter value.

The question: how can I update the form properly?