Hi,
I One Table in the onDelete Trigger i Have Code that checks
if a part of the record that i want to delete have a relation to a record in another table, if they are are relation, i would stop the delete Process.
But i don't know who.
Here my Code that not works:
myRecord.RESET;
myRecord.SETFILTER("myField",'myData');
IF myRecord.FIND('-') THEN BEGIN
MESSAGE('Don't Delete Them');
EXIT;
END ELSE BEGIN
MESSAGE('ok, must delete');
END;
Thanks
PS: I think that the EXIT Command ist wrong for this way ?
Comments
It Must be ERROR and Not MESSAGE :P
So it's right:
If i put EXIT(FALSE) it say may that :
"A variable was expected"
If i put only EXIT it's okay but does not exit.
No i have it so, an it works:
I Think that an EXIT an this position is more nice than the error message because, so the user must first press the confirm and second press the message thats say him that was not deleted, but if i put an EXIT there where ist the ERROR now, it delete me the record and EXIT(FALSE) would expected a variable ?
Thanks.
The "Variable Expected" is that the OnDelete trigger by definition has no return value.
You can use which stops the transaction and doesn't displays any error.
Arhontis
https://forum.mibuso.com/search
Thankkkkks :P