Summary
With D365 V9, there are lot of updates to Development specially in Client API/ Form Scripting in CRM.
I am starting a series of blogs to cover all the new features with code samples and examples. Lets start with Xrm.Utility client API updates
showProgressIndicator
This function displays a dialog, where you can customize the message to be shown in the progress message.
This is useful when there are long API calls/ or CRUD operations in the background to show some message to the end user.
Things to Know:
- Since it is part of Xrm.Utility namespace, it will also work with Web resources. So you can leverage a consistent Progress Indicator
- It works in both D365 Web Client Interface and Unified Interface.
Screenshots:
- On web client:
- On Unified Interface:
Please see below code sample:
var D365V9 = {}; /// This Event is Set to trigger on change of Probability. This can be updated as per requirements. D365V9.ShowProgress = function () { Xrm.Utility.showProgressIndicator("Performing Custom Operations in Background. Please Wait.."); window.setTimeout(function () { /// For demo, I am using Timeout of 4secs, to close the progress Indicator Xrm.Utility.closeProgressIndicator(); }, 4000); } |
You can use closeProgressIndicator to stop showing the message.
If showProgressIndicator is invoked, while there is already one on the page, it will just update the existing message. So at a time, there will be only 1 progress indicator.
Note
- The progress dialog blocks the execution until it is closed using the closeProgressIndicator method. So, you must use this method with caution.
- This is only available in D365 V9
Foot Notes: You can also refer my GitHub for code examples
I will be posting more blogs on the new Developer Updates.
Happy CRM’ing