Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Show progress indicator not appearing when I run my code

Posted on by 92

Hello,

I hope someone can help me with my problem.

I created a javascript that calls a process to run a plugin, meanwhile, I added

Xrm.Utility.showProgressIndicator("Processing..."); to show a loading screen as the plugin executes.

I will add an attachment of my code so you may see where I am showing and closing the progress indicator.
The problem is that the code was working fine and suddenly it stopped showing the progress indicator.
I tried to debug my to check the error but Xrm.Utility.showProgressIndicator("Processing..."); is returning undefined and I guess it is working.
I hope someone can help me and assist me to show the progress bar indicator.
I am showing the progress indicator on line 2.
Closing it on lines 52 and 98.
[View:/cfs-file/__key/communityserver-discussions-components-files/117/HireOnClick.js:320:240]
pastedimage1671612724964v2.gif
 
Thank you!
  • Show progress indicator not appearing when I run my code
    Not sure if you have resolved this issue. The first problem appears to be the logic of the code itself. As the debugger shows, setting the "res" variable to the "showProgressIndicator" statement means "res" will always be undefined. So the While loop never starts.

    Similar to the OP's issue, the second problem has to do with the indicator displaying; but my problem was the indicator started only after the plugin logic finished.

    To get around this, I wrapped the main logic of the JavaScript in the setTimeout callback. I put the "closeIndicator" function in the plugin request callback as part of the main function logic.
     
    function CallCustomActionFromJavaScript(primaryControl){
    debugger;
    
        Xrm.Utility.showProgressIndicator("Custom Message");
        setTimeout(mainFunction, 1000);
        
        function mainFunction(){}
    }
     
  • MBaba Profile Picture
    MBaba 92 on at
    RE: Show progress indicator not appearing when I run my code

    Hello Abdul Wahab ,

    Thank you for your help.

    I have already read these blogs and checked them, yet its still not working.

    As you can see in my GIF it is returning undefined, as it should, but the loading UI is not appearing.

    Thank you!

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans