D365 V9 – Developer Updates – Part 1: Show Progress Indicator

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:

  1. Since it is part of Xrm.Utility namespace, it will also work with Web resources. So you can leverage a consistent Progress Indicator
  2. It works in both D365 Web Client Interface and Unified Interface.

Screenshots:

  1. On web client:10Nov2017_2
  2. On Unified Interface:10Nov2017_1

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

  1. The progress dialog blocks the execution until it is closed using the closeProgressIndicator method. So, you must use this method with caution.
  2. 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s