Delete detail record

when delete a record, I want delete also detail record.
How can I do this?
There is an automatic procedure?

Re: Delete detail record

You can use form settings -> Dependencies
or simple do this:
on the event onAfterDelete, use sc_exec_sql(“DELETE FROM CHILDTABLE WHERE PARENTKEY = ‘{KEY}’”);