I would like to start transaction, put some records in table and commit it. Also I want to be able to rollback in case of any errors. How can I do than from C/AL code? With best regards, Andrew
You can break a transaction with the ERROR-command whenever you want to; then all transactions will be rolled back automatically. BUT - only transactions made AFTER a commit or since the first write-transaction (insert/modify/delete).
Additional tip: Rolling back the changes since the last commit without displaying an error message box can be done by calling ERROR with an empty string as a parameter: ERROR(); Kind regards, Jan Hoek Weha Automatisering BV Woerden - The Netherlands