Friday, October 16, 2015

An Unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected

Issue :- I was trying to import the class in the application and when I click on any button to import or cancel the import I was getting this error as An unbalanced X++ TTSBEGIN/TTSCOMMIT. which means there are too many TTSBEGIN/TTSCOMMIT  statements.

And the TTS level is "2".

At this unable to import the class as the dialog box throws error on all the buttons.

To resolve this error you need to remove all the extra TTSBEGIN/TTSCOMMIT from the code.

This can be done with the simple Job which is return below.

To resolve this error this TTS level should be ZERO, Run this job to get rid of that error, this job will find the tts level where its greater than zero and make it zero by calling TTSABORT.
static void TheAxaptaResetTTS(Args _args)
    while (appl.ttsLevel() > 0)
        info(strfmt("Level %1 aborted",appl.ttsLevel()));


ttsBegin: marks the beginning of a transaction. This ensures data integrity, and guarantees that all updates performed until the transaction ends (by ttsCommit or ttsAbort) are consistent (all or none).

ttsCommit: marks the successful end of a transaction. This ends and commits a transaction. MorphX guarantees that a committed transaction will be performed according to intentions.

I got the above information from the below source :

above blog is very helpful you will get the help for most of the solutions.

No comments:

Post a Comment

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// &l...