I am trying to implement a transactional logic in D365FO. I have two tables, table1 and table2, and I want to insert a record in both of them. However, I want to make sure that if the insertion in table2 fails, the insertion in table1 is also rolled back. How can I achieve this using X++ code?