AngelRodriguez
4 years agoQrew Assistant Captain
Set custom table rule to prevent deletion of a record if child record count is greater than 0
I have a Processes table (parent) and a Tasks table (child). In my Processes table, I have a count of completed child tasks that I'm keeping track of to display to users and for an automation I added. Is there a way to write a custom data rule for the Processes table where it looks for the count of tasks, if the number is greater than 0, show a warning message and do not allow the user to delete the record? Right now, I have a custom table rule that reads:
But I'm not sure how to get this system to stop the delete process if the Tasks condition is true.
------------------------------
AR
------------------------------
If (
[Number of Completed Tasks] > 0,
"There are currently " & [Number of Completed Tasks] & " completed tasks that belong
to this process. If you'd like to delete this process, please delete all completed
tasks for this process first."
)
But I'm not sure how to get this system to stop the delete process if the Tasks condition is true.
------------------------------
AR
------------------------------