Morning all! I'm wondering if there is any way to ...
# suitescript
p
Morning all! I'm wondering if there is any way to intercept a delete action with a client script? essentially I want to emulate the "you cannot delete a record while child records" in a dialog for records that are not "system recognised" as being child records
s
Use a before submit script and ("context.type == "delete"){ //your code here }
p
This is in relation to a client script.
s
still waking up lol - my bad... not sure but check if anything executes before the record is deleted on saverecord. That could be it
p
yeah, cant see anything referencing the delete event type on saverecord, hoping someone has a trick up their sleeve
c
The better way of doing this is to remove the delete button when child records exist
p
That is certainly an option, wasn't aware you could remove from that actions menu there. Ideal scenario is a custom delete function that recursively removes the children