nerdexam
Microsoft

MB-500 · Question #163

Drag and Drop Question A company uses Dynamics 365 Finance. The company wants to create test cases by using the SysTest framework. You need to select the appropriate TestTransactionMode option for…

The correct answer is LegacyRollback; AutoRollback. SysTest Framework: TestTransactionMode Options Background The SysTest framework in Dynamics 365 Finance uses TestTransactionMode to control how database transactions are handled during test execution. The goal is usually to isolate test data so it doesn't pollute the database…

Develop and test code

Question

Drag and Drop Question A company uses Dynamics 365 Finance. The company wants to create test cases by using the SysTest framework. You need to select the appropriate TestTransactionMode option for each requirement. Which options should you use? To answer, drag the appropriate options to the correct requirements. Each option may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point. Answer:

Exhibit

MB-500 question #163 exhibit

Answer Area

Drag items

AutoRollbackLegacyRollbackLegacyRollbackWithUpdateTrackingNone

Correct arrangement

  • LegacyRollback
  • AutoRollback

Explanation

SysTest Framework: TestTransactionMode Options

Background

The SysTest framework in Dynamics 365 Finance uses TestTransactionMode to control how database transactions are handled during test execution. The goal is usually to isolate test data so it doesn't pollute the database.


The Four Options Explained

OptionBehavior
NoneNo automatic rollback. Test data persists in the database after the test runs.
AutoRollbackWraps the entire test in a transaction that is automatically rolled back after the test completes. Modern, clean approach.
LegacyRollbackUses the older rollback mechanism. Suitable for tests that contain ttsbegin/ttscommit blocks internally, since AutoRollback cannot nest inside an already-open transaction.
LegacyRollbackWithUpdateTrackingLike LegacyRollback, but additionally tracks which records were updated, allowing more granular rollback control.

Why This Arrangement

Position 1 → LegacyRollback

This is the correct choice when the test contains its own ttsbegin/ttscommit transaction blocks. AutoRollback wraps the test in an outer transaction - if the test then opens its own inner transaction, D365 Finance will throw an error because nested transaction commits are not permitted in this context. LegacyRollback sidesteps this by using a rollback mechanism that is compatible with tests that manage their own transactions internally.

Position 2 → AutoRollback

This is the correct choice for standard tests that do not open their own transactions. The framework automatically wraps the test method in a transaction and rolls it back upon completion, leaving the database in its original state with zero manual cleanup required. This is the recommended default for most modern unit tests.


Common Mistakes and Misconceptions

  • Using AutoRollback when the test has its own ttsbegin/ttscommit: This causes a runtime error. The outer AutoRollback transaction conflicts with the inner one.
  • Using None thinking it is "simpler": This pollutes the database with test data and makes tests non-repeatable.
  • Confusing LegacyRollbackWithUpdateTracking as always better than LegacyRollback: The update tracking variant adds overhead and is only needed when you specifically need to track which records changed - not a general-purpose substitute.
  • Assuming AutoRollback is always the right modern answer: It is only correct when the test itself does not manage transactions.

Quick Rule of Thumb

Test manages its own transactions (ttsbegin/ttscommit inside)LegacyRollback

Test does NOT manage its own transactionsAutoRollback

Topics

#SysTest framework#TestTransactionMode#unit testing#AutoRollback

Community Discussion

No community discussion yet for this question.

Full MB-500 Practice