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

Hi,

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…

Thanx,
Kennet

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
TempTest.COPY(Rec);
Found := TempTest.FIND(Which);
IF Found THEN
Rec := TempTest;
EXIT(Found);

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

Form - OnInsertRecord(BelowxRec : Boolean) : Boolean
TempTest := Rec;
TempTest.INSERT(TRUE);
EXIT(FALSE);

Form - OnModifyRecord() : Boolean
TempTest := Rec;
TempTest.MODIFY(TRUE);
EXIT(FALSE);

Form - OnDeleteRecord() : Boolean
TempTest := Rec;
TempTest.DELETE(TRUE);
EXIT(FALSE);