1

I am experiencing a critical error when i try to change some sales order lines in a specific intercompany sales order.

When i try to update my order i get presented with a "Overwrite prices and discounts"-dialog:

Overwrite prices and discounts

If i try to press OK or Cancel, AX throws a Transaction tracking error.

An unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected. Causes of this include (a) too many/few TTSBEGIN or TTSCOMMIT, (b) return calls within TTSBEGIN/TTSCOMMIT pairs, and (c) user interaction within TTSBEGIN/TTSCOMMIT pairs.

The current TTS level is '5'.

I did some digging around with the debugger and found that official code from Microsoft is doing something like this:

  1. Stack up some TTS
  2. Change to buying company
  3. Display dialog
  4. As a result of the dialog, the TTS gets confused and all kinds of wierd things starts happening.

How can i either:

  1. Fix it.
  2. Disable the dialog all together and have it execute some default behaviour.
AnthonyBlake
  • 2,334
  • 1
  • 25
  • 39
Erik Ellis
  • 61
  • 2
  • 7

1 Answers1

3

A dialog cannot be shown to a user within a TTSBEGIN - TTSCOMMIT pair in AX 2012.

The related MSDN is here;

X++ Standards: ttsBegin and ttsCommit (AX 2012)

I can understand why microsoft would want to do this, as a required user interation between a pair can cause performance issues, specifically database locks. Business logic should also be completely separate from the UI, and therefore user interaction.

I would fix it if I were you. If the dialog is required, gather the information from the user before you TTSBEGIN, ready for use later.

As you suggest this is official code from Microsoft, I would also suggest you check the latest CU to ensure it has not already been fixed, and if it has not file a bug report.

AnthonyBlake
  • 2,334
  • 1
  • 25
  • 39