Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Show loading GIF.

(0) ShareShare
ReportReport
Posted on by 510

Hello everyone.

I have a requirement here that I need to show a waiting screen to the user while a plugin execute.

I know many ways for doing that, but almost all are unsupported. The only supported way that I know is calling the Alert.Js solution methods to open a modal dialog, hide this modal dialog before showing on screen and show a <div> with the GIF instead, all inside the HTML WebResource.

So, Does anyone know an easy supported way for doing that?

Note: I tried to use the supported method "Xrm.Utility.openWebResource" but it is opening my HTML in another screen.

Cheers.

*This post is locked for comments

  • TemaPrinter Profile Picture
    5 on at
    RE: Show loading GIF.

    Hello HenriquePalomo you can find the preloader gif http://icons8.com/preloaders

  • Suggested answer
    Syed Ibrahim Profile Picture
    6,257 on at
    RE: Show loading GIF.

    Hi Henrique,

    There is cool feature new release (v9) to make user to wait upon some time take operation in the background by showing custom message on progress bar.

    Call the below js upon the event triggered.

    function ShowCustomMsg() {

    Xrm.Utility.showProgressIndicator("Loading contact Details..");

    setTimeout(delayedLoadPrimaryContact, 10000); }

    function delayedLoadPrimaryContact()
    {
        var contact = Xrm.Page.getAttribute("primarycontactid").getValue();
        if(contact == null){
           Xrm.Utility.closeProgressIndicator();
           return;
        }
        Xrm.WebApi.retrieveRecord("contact", contact[0].id, "$select=emailaddress1")
        .then(function(result) {
            var email = result["emailaddress1"];
            Xrm.Utility.closeProgressIndicator();
            alert("Here is the email: "+email);
        })
        .fail(function(error) {
            Xrm.Utility.closeProgressIndicator();
            var message = error.message;
            alert("Error: "+message);
        });
    }

    For more detail. Pls refer below link.

    https://community.dynamics.com/crm/b/exploringdynamics365/archive/2017/10/17/dynamics-365-v9-progress-indicator-api

  • Verified answer
    tw0sh3ds Profile Picture
    5,600 on at
    RE: Show loading GIF.

    There is no supported way of doing that. But using Alert.js is something I like to call "acceptable unsupported" if you are using this for user's convenience, not as something driving your business process. So showing loader is perfectly fine, just have in mind that it will not work on mobile devices, so you should put a proper JS to do it only for standard web clients.

    This is supported Out-Of-The-Box in Dynamics 9.0 and since you are on Online - you will soon be having this version. So simply use Alert.js if you NEED it now (or convince CRM Product Owner that it will be supported soon and it's good to wait) but write also code using new Xrm.Utility.showProgressIndicator function if it's available (you can simply do if(Xrm.Utility.showProgressIndicator) in JS it's really easy...) so that after migration to the newest version, you will not have to move a finger to change that.

    EDIT: Too slow, Andrii and Aric already posted the same. On Wild West I would be dead already :)

  • Suggested answer
    Aric Levin Profile Picture
    30,188 Moderator on at
    RE: Show loading GIF.

    Hi,

    If you are using D365 v9 you can use the Xrm.Utility.showProgressIndicator and closeProgressIndicator methods.

    If you are using an earlier version you need to use Xrm.Utility.openWebResource.

    You can also use alert.js:

    github.com/.../alertjs

    alert.js has a method called Alert.showLoading

    Hope this helps.

  • Verified answer
    a33ik Profile Picture
    84,325 Most Valuable Professional on at
    RE: Show loading GIF.

    Hello,

    If you're on v9.0 then you can use Xrm.Utility.showProcessIndicator/Xrm.Utility.closeProcessIndicator - butenko.pro/.../microsoft-dynamics-365-v9-0-whats-new-in-clientside-for-devs-besides-xrm-webapi

    But if you're on earlier version you have no options and just FYI Alert.js is not supported extension because it uses DOM manipulations. But you can check source of it to get understanding how it's done - github.com/.../alert.js

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans