DYNAMICS 365 DISPLAY LOADING PROGRESS INDICATOR ON FORM

Most probably, you have faced a scenario where you need to block the user from interacting with the form and you want him to wait a little bit until a process is completed and then he can work again on the form.

However, blocking the user from working without informing him that something in the background is being processed is not a pretty thing to do.

Therefore, and to avoid this misunderstanding, you can display a loading dialog to inform him of this behavior, so he knows that he should wait a little bit before resuming the work on the form.

To achieve this, there is a straight forward method to do it, which is by using the Xrm.Utility.showProgressIndicator("Processing... Please wait!!!") method in the JavaScript.

You can add this line of code in any function, where you want to block the user from interacting with the interface while you are waiting for a process to be completed. Once the process is done, you can then remove the loading dialog and the user can resume his work on the form.

Furthermore, to remove the loading dialog, you can use the method Xrm.Utility.closeProgressIndicator().

The loading process dialog will look as in the below picture with the message you defined as parameter. Loading progress indicator


Bonus Tips:
  • To update the displayed message in the loading dialog, you can simply do another call to the method showProgressIndicator and the message will be overridden with the latest text specified in the latest method call
  • The progress dialog will block the User until it is closed by the call of the method closeProgressIndicator
  • The method closeProgressIndicator will do nothing and will not affect the User Interface if there is no progress dialog currently displayed

Hope This Helps!

Comments

Popular posts from this blog

DYNAMICS 365 FILTER LOOKUP FIELD BASED ON N:N RELATIONSHIP

DYNAMICS 365 LEVEL UP BROWSER EXTENSION - PART 1 - FORMS

DYNAMICS 365 REFERENCE PANEL