In a form I have a “Document (File Name)” upload field.
I am aware that if I have a record that has an uploaded file associated with it, if I tick the “Delete file” check box and save the record, it effectively removes the name of the file from the record (but leaves the actual file on the server). I understand that this is by design, and that if you actually want to delete the file you need to code it yourself (which is what I want to do).
Well, that’s all fine and I am quite happy with how to code the file deletion. However, what is not clear is how I trap that change so I can insert my deletion code? I have tried in “onBeforeUpdate”, and “onAfterUpdate”, and there is no “onRecord” event for Forms at all. None of those events are triggered when you tick the “Delete File” check box and then click Save. It would seem that the “state” of that field is saved independently of the overall record that “houses” it.
So how do I detect that change?
In advance - many thanks!