Version: 7.5.7.1 (X86_64) / LibreOffice Community
Build ID: 47eb0cf7efbacdee9b19ae25d6752381ede23126
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: pt-BR (pt_BR.UTF-8); UI: pt-BR
Calc: threaded
Morning, I’m looking for a way to edit this macro below so it only deletes the record of a specific form, and not the last one I interacted with, I tried using getbyname, but I wasnt successfull.
sub DeleteRecord
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:DeleteRecord", "", 0, Array())
end sub
I need it to be a macro and not the default options of LO Base because I need to validate if the record was deleted in order to execute the rest of the macro, that will be responsible for the deletion of the image that was linked to the form in its specific folder. The deletion part is working, but I cant find a way to put it in a event that work as I need, when I put it on the action of the button, if the user cancel the record elimination, the image will be deleted anyway, and thats not ok, I tried linking it to the form control event of confirm elimination, but instead of asking if the user is sure, it just erase the record and the image on click, so I had this idea to mix the two erase macros, any help is welcome.