Hi Roy,
Using a Task to Delete dependencies + the main record is the most convenient for this. Tasks can also have a confirmation message in which you can use parameters that you can fill with for instance the dependencies.
Alternatively you can use Reference settings like On delete Cascade or On delete Set null but I don't recommend doing this unless you understand the impact it has on your data. Using Tasks does require more maintenance but you do have full control over what happens upon delete.
Thanks Mark,
Is it possible to attach this task to the standard delete-action (the red ?
I was afraid of that. But added my vote to this wish.
Hope it will be implemented soon.
Extra idea.
Is it possible to use an instead-of-trigger and be able to send an error message from there?
You could do that yes if you are using a View. The delete action then triggers that trigger in which an tsf_send_message is executed. It does limit the message to being informational, and not interactable to the extend of letting the user decide to continue or stop the Delete action. This is the main difference with using a Task with a confirmation message.
This means that an instead-of-trigger can only work with view (and maybe snapshot), but not with a normal table?
The confirmation message on a task seems like a message with a fixed text. Maybe instead I could use a read-only parameter of which the value will be determined by a default expression. Can I use the t1 or other parameters within this expression?
But probably better to use a task that will start a process flow. There you can first determine which kind of message will be displayed and how to react to that input. And then continue with normal message and delete
You can have Instead of triggers on Tables, but it is usually not used as far as I have experienced. About using Snapshots, read the following topic first: What are 'Snapshot' views and how to use them? | Thinkwise Community (thinkwisesoftware.com)
"Can I use the t1 or other parameters within this expression?”:
I believe this won't work as The query cannot use any of the column values of the new record: Data model · Thinkwise Docs (thinkwisesoftware.com). I think you will still need to use a Default procedure to fill (hidden/read only) parameters.
Using a Process flow is an option, although it will trigger the message after the Task is successfully executed. So the only way to make this work, if by using a Task without logic first, then give the message and ending with another Task to process the given command; either deleting the records or aborting the Delete entirely.