nerdexam
Microsoft

MB-500 · Question #209

Drag and Drop Question You are a Dynamics 365 Finance developer. A long running process times out in the system. You need to implement the asynchronous framework to resolve this issue. Which class…

The correct answer is Global; FormRun; Global. Dynamics 365 Finance: Asynchronous Framework - runAsync Class Selection Background In D365 Finance (X++), the asynchronous framework lets you offload long-running processes to avoid session timeouts. Two key classes expose a runAsync method: Global and FormRun. Choosing between…

Develop business logic

Question

Drag and Drop Question You are a Dynamics 365 Finance developer. A long running process times out in the system. You need to implement the asynchronous framework to resolve this issue. Which class runAsync method should you use for each use case? To answer, drag the appropriate classes to the correct use cases. Each class may be used once. more than once, or not at content. NOTE: Each correct selection is worth one point. Answer:

Exhibit

MB-500 question #209 exhibit

Answer Area

Drag items

FormRunGlobal

Correct arrangement

  • Global
  • FormRun
  • Global

Explanation

Dynamics 365 Finance: Asynchronous Framework - runAsync Class Selection

Background

In D365 Finance (X++), the asynchronous framework lets you offload long-running processes to avoid session timeouts. Two key classes expose a runAsync method: Global and FormRun. Choosing between them depends on whether the operation requires a form/UI context.


The Two Classes Explained

ClassContextWhen to Use
GlobalNo form/UI session requiredServer-side operations, non-UI async calls
FormRunRequires an active form sessionOperations that interact with or update form controls/UI

Arrangement Breakdown

Placement 1 → Global Used when the async operation runs independently of any form. Global::runAsync spawns a new server-side session with no UI dependency. Typical use: triggering a background calculation or data process from a non-form context (e.g., service class, batch trigger).

Placement 2 → FormRun Used when the async operation needs access to the calling form's context - for example, reading form datasource records or updating form controls after completion. FormRun::runAsync preserves the form session so UI interaction remains valid.

Placement 3 → Global Again server-side, no form context. This reinforces that Global::runAsync is the general-purpose async launcher when the operation is purely business logic with no UI involvement.


Common Mistakes

  • Using FormRun for server-only tasks: Unnecessary overhead; form context isn't available in all execution environments.
  • Using Global when UI updates are needed: The async callback won't have access to form controls, causing runtime errors or silent failures.
  • Assuming Global means "global scope": In this context it refers to the Global kernel class and its static runAsync method, not a variable scope concept.

Key Rule of Thumb

If the async operation touches the UI or form data, use FormRun::runAsync.
For everything else (pure logic, server-side), use Global::runAsync.

Topics

#async framework#runAsync#FormRun#Global class

Community Discussion

No community discussion yet for this question.

Full MB-500 Practice