Share via


X++ Standards: ttsBegin and ttsCommit

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

ttsBegin and ttsCommit must always be used in a clear and well-balanced manner. Balanced ttsBegin and ttsCommit statements are the following:

  • Always in the same method.

  • Always on the same level in the code.

Avoid making only one of them conditional.

Use throw, if a transaction cannot be completed.

Do not use ttsAbort; use throw instead.

Do not use anything that requires a user interaction within a transaction (such as an action on a dialog box).

See also

Transaction Integrity

Exception Handling with try and catch Keywords

X++ Coding Standards

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.