@Servoy, is it possible to add a functionality that checks if you can delete a record which returns true/false?
Now when you delete a record and if the relation restriction doens’t allow it, it throws an error.
But I would like to inform my user before doing the real delete.
I’ve been thinking and I think I can write something like this using the SM and check it myself using a recursive method, but of course it would be better if this is standard functionality in Servoy.
That is how it works now, but errorhandler is for me errors.
And it will show an error in the log and send an email to our support department.
I want to avoid that.
Even more perfect I would like to tell the user, what relation causes that the record can not be deleted.
For example if you want to delete a customer and there are still invoices for that customer, then the relation customer_to_invoice doesn’t allow onParentDelete, DeleteChildren
So if Servoy can’t do this, I’ll write a recursive method myself.
But if Servoy can, it would be a good functionality for all of us
there is currently no hook that sits between the delete and that exception
the only way currently is by the errorHandler (i think try/catch around delete also doenst work because that exception isnt catchable)
I completely agree! We also asked for that some time ago, as we model the data (with Entity Modeler) and put all relevant business logic information in there, which means there is quite a bit of logic in the database. But unfortunatly it is not so well accessable right now from Servoy. So hopefully we will be heard
Best regards, Robert
martinh:
Hi,
@Servoy, is it possible to add a functionality that checks if you can delete a record which returns true/false?
Now when you delete a record and if the relation restriction doens’t allow it, it throws an error.
But I would like to inform my user before doing the real delete.
I’ve been thinking and I think I can write something like this using the SM and check it myself using a recursive method, but of course it would be better if this is standard functionality in Servoy.