Macro to clear unsaved status of a form/document

LibreOffice 7.1.4 on windows10 and ubuntu 21.04

I have a form used for filtered display of table data
At the end of the work, only change is filer term causing save document prompt on exit.

in MS access i would call :
If Me.Dirty Then Me.Dirty = False
on every filter term update to clear unsaved flag and avoid popup on form close.

is there a way to achieve the same in LibreOffice, writer in my case, but i believe it would apply to all components.

great knowledge mine there:
https://www.pitonyak.org/oo.php
solution is:

If (ThisComponent.isModified()) Then ThisComponent.SetModified(false) End If