If you end up running some code in Ax that have an uneven number of ttsBegin/ttsAbort calls you will end up with the following error message
To recover from this annoying problem you can run this small job to automatic reset the ttsLevel to 0 in order to make Ax work properly again
static void ResetTTS(Args _args)
while (appl.ttsLevel() > 0)
info(strfmt("Level %1 aborted",appl.ttsLevel()));
After recovering you have to inspect your code by counting and ensuring that you never call ttsBegin without ending the transaction locking by calling ttsAbort og ttsBegin in the same level of code.
Unbalanced X++ TTSBEGIN/TTSCOMMIT – Microsoft Dynamics AX / Axapta – Developer Forum – Dynamics User Group