In this Blog, we will show how to display a progress indicator or loading screen in the dynamics 365
If you want to show a loading/waiting screen to let users know there’s some heavy processing going on in the back-end and they shouldn’t navigate away to do anything else with the record, you can do so by using the showProgressIndicator() and closeProgressIndicatory() methods.
Xrm.Utility methods
There are two methods listed in the Xrm.Utility of Microsoft Docs that you can utilise to do this.
In this case, suppose you want to display the Loading page while the JavaScript code performs your Action.
In order to start an action, you can put the code Xrm.Utility.showProgressIndicator(message); before the action is started, and you can use Xrm.Utility.closeProgressIndicator(); in the success and failure messages.
function ShowProgressIndicator(executionContext) {
var formContext = executionContext;
Xrm.Utility.showProgressIndicator(“CRMONCE Progress Indicator”);
setTimeout(function(){
Xrm.Utility.closeProgressIndicator();
}, 5000);
}
Execution
Every time your JS code executes the action, the progress message will be shown on the screen as shown below.
The Xrm.Utility.closeProgressIndicator will also remove the message as seen below once the process is finished and return back the form you were working on.