Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Showing Processing/Loading Icon when Action is being called

Posted on by 1,875

Hi

I have a custom ribbon button on opportunity entity form. When user clicks on that an action is being called using Dynamics CRM Web API.

Action creates another record and then that record is being opened in new window.

When user clicks on the button , the command bar is greyed out until the action is executed and response is received.

I want to show an image or gif like Processing... till the time Action is being executed.

How can I do that?

*This post is locked for comments

  • Ramakanta Profile Picture
    Ramakanta 2,715 on at
    RE: Showing Processing/Loading Icon when Action is being called

    I am loving the progress indicator...but unfortunately it works for 9.x versions only ,i am using 8.2 :-)

  • RE: Showing Processing/Loading Icon when Action is being called

    A very quick way to indicate that something is happening:

    Xrm.Utility.showProgressIndicator("Processing..."); // also freezes UI

    ...

    Xrm.Utility.closeProgressIndicator();

    See

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-utility/showprogressindicator

  • Ramakanta Profile Picture
    Ramakanta 2,715 on at
    RE: Showing Processing/Loading Icon when Action is being called

    @Ravi ,I am able to call/see the loading message on button click,but when i add  Alert.hide() function to hide my loading message after my operation completion,it's not working.

    Below is my code,i am using Version 1612 (8.2.2.112) (DB 8.2.2.112) on-premise,In order ensure my opertion taking some time i am pausing my thread for 30 .If i am adding only

     Alert.showLoading() then its showing me the message,but facing issue  when i add the Alert.hide() function.Any help will be appreciated

    function alertTest()

    {

       Alert.showLoading();

           var actionName = "Microsoft.Dynamics.CRM.getfrightrate";

           var quoteId = firstPrimaryItemId.replace('{', '').replace('}', '');

           var actionResponse = CallCustomAction(quoteId, actionName);//Opertion will take > 30sec

           Alert.hide();

    }

  • Ramakanta Profile Picture
    Ramakanta 2,715 on at
    RE: Showing Processing/Loading Icon when Action is being called

    Thnaks Ravi...

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Showing Processing/Loading Icon when Action is being called

    Hi RK,

    You should be able to change the text in the base alert.js file. Here is the method for loading which can be changed-

    Alert.showLoading = function (url) {

       Alert.show("Loading...", null, [], "LOADING", 230, 115, url, true);

    }

    Hope this helps

  • Ramakanta Profile Picture
    Ramakanta 2,715 on at
    RE: Showing Processing/Loading Icon when Action is being called

    @Ravi Is there any way can we change the text in Alertjs  ,from " Loading" something like "Processing" ,i am using Alert.js v2.1 with Dynamics 365 v8.2

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Showing Processing/Loading Icon when Action is being called

    I had a button in command bad which -

    1. Display the notification that "Process started...."

    2. Call the Custom Action

    3. Display the notification that "Process completed..."

  • Deeps Profile Picture
    Deeps 1,875 on at
    RE: Showing Processing/Loading Icon when Action is being called

    Did you call this from Command Bar? I tried and nothing showed up. I will try again this alertjs

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Showing Processing/Loading Icon when Action is being called

    Hi,

    Its not straight forward or OOB implementation. As suggested above, this can be done with custom implementation using JavaScript, Web Resource Web pages etc...

    You can also use already built alert.js solution which has a method to show loading -

    github.com/.../Documentation

    I had similar requirements and in my case, I used the OOB notification  "Processing started..." before starting the WEB API Call and then after the call a notification "Processing completed...". This approach is also used in PSA implementations

    Hope this helps.

  • Deeps Profile Picture
    Deeps 1,875 on at
    RE: Showing Processing/Loading Icon when Action is being called

    So, is that not possible?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans