OnDeleteRecord trigger in form is not called when using temporary record.


When using a form to display records from a temporary table, if you select one or more lines the trigger OnDeleteRecord is not run when you press F4 or Delete. But if you don’t select a line and press F4 or Delete it will delete that line or if you select all records by for example pressing Ctrl+A it will also work fine. This is with both 4.0 and 4.0 SP2.

Has onyone else had this problem or is it just me being stupid? I’ve attached a fob if you want to try it out…


Which trigger?

Form - OnDelete or

Table - OnDelete

I remember in the early days hearing that the OnDelete trigger wasn’t run, if you clicked the upper left corner to select all the records, and used F4 - but if you used [del] it worked fine…

Did you try - just for arguments sake - if there are a difference using [del] vs [F4]?

It’s the Form OnDeleteRecord. And no, there is no difference using F4 or Delete, the difference is all in how you select what to delete.

Ctrl+A, clicking in the top-left-corner of the tablebox or just leaving the cursor on a line (not selecting any line) works fine with both F4 and Delete (as expected).
But if I select lines by clicking in the box to the left of one line (or more lines) or if I select lines with Shift+up-/down-arrow, the trigger is not called.

Can you export the form, as .txt - or paste the code.

It looks and sounds strange. However I have an issue that a a little similar; Where the Ctrl+A doesn’t work as I expect - But I think it’s my code.

This is the code in the form:

Form - OnFindRecord(Which : Text[1024]) : Boolean
Found := TempTest.FIND(Which);
Rec := TempTest;

Form - OnNextRecord(Steps : Integer) : Integer
ResultSteps := TempTest.NEXT(Steps);
IF ResultSteps <> 0 THEN
Rec := TempTest;

Form - OnInsertRecord(BelowxRec : Boolean) : Boolean
TempTest := Rec;

Form - OnModifyRecord() : Boolean
TempTest := Rec;

Form - OnDeleteRecord() : Boolean
TempTest := Rec;