How to Display a Progress Indicator or Loading Screen in Dynamics 365 CE

How to Display a Progress Indicator or Loading Screen in Dynamics 365 CE

In Dynamics 365 Customer Engagement (CE), users may experience delays when executing long-running operations such as data processing, API calls, record creation, or workflow execution.

Displaying a progress indicator or loading screen improves user experience by providing visual feedback that the system is processing the request.

Why Use a Progress Indicator?

Show a Progress Indicator

Use the showProgressIndicator() method to display a loading screen.

Xrm.Utility.showProgressIndicator(
    "Please wait while the record is being processed..."
);

This displays a modal loading screen with a progress message.

Close the Progress Indicator

After processing is complete, close the indicator using closeProgressIndicator().

Xrm.Utility.closeProgressIndicator();

Complete Example

The following example displays a loading screen, performs processing, and then closes the indicator.

function processRecord()
{
    Xrm.Utility.showProgressIndicator(
        "Processing record..."
    );

    setTimeout(function()
    {
        Xrm.Utility.closeProgressIndicator();
    }, 5000);
}
Important: Always close the progress indicator after processing completes. Failing to do so may leave the loading screen visible indefinitely.

Common Use Cases

Best Practices

Advantages of Progress Indicators

Key Takeaways