Delete Transaction data in Ax 2012

You can refer below link to Delete Transaction data  in Ax 2012.

Delete Transaction data

To delete data in Axapta 2009 you can run a class sysdatabasetransdelete.