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?
- Improve user experience
- Provide visual feedback during processing
- Reduce repeated user clicks
- Prevent confusion during delays
- Make long-running operations appear responsive
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
- Record creation and updates
- Custom API integrations
- Power Automate trigger execution
- Bulk data processing
- Workflow automation
- External service calls
Best Practices
- Display meaningful progress messages.
- Always close indicators after processing.
- Use loading screens only when necessary.
- Handle exceptions properly.
- Test long-running operations thoroughly.
Advantages of Progress Indicators
- Better user experience
- Professional application behavior
- Reduced user frustration
- Clear processing status
- Improved usability
Key Takeaways
- showProgressIndicator() displays a loading screen.
- closeProgressIndicator() removes the loading screen.
- Useful for long-running operations and integrations.
- Improves user experience and responsiveness.
- Always close the indicator after processing completes.