0

Is it possible to delete a file using a button element?

I’m using the code below to create a button that generates a report and attaches the PDF file to the current record:

 

let pdf := printAndSaveRecord(this, "Employee Schedule Report”);

let name := “Employee Schedule” + ".pdf";

importFile(this, pdf, name)

 

That works fine, but I also need a way to trigger Ninox to determine if that file already exists for the current record and if it does exist, to delete it. I’ve looked through the user documentation and Ninox forum but haven’t found a solution yet. Any suggestions would be greatly appreciated!

1 reply

null
    • Birger_H
    • 4 yrs ago
    • Reported - view

    This is possbible if the attachment is displayed in an image field. You can delete the attachment like this:
    –––
    'image field' := null
    –––

    Birger

Content aside

  • 4 yrs agoLast active
  • 1Replies
  • 1627Views