web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

XRM showprogressindicator function not work

(2) ShareShare
ReportReport
Posted on by 6
I want to show the progress indicator after user confirm. But it not work now .  And I was tested  the other function( alterDialog ) of XRM, it's useful. What's the issue with my code?
issue.js

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (0)
  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at
    Not able to see attachment.
    Please share your code along with image.
  • tmeloooo Profile Picture
    6 on at
    this.DraftBatchDelete = function (ID, primaryCtrl) {
        debugger;
        var confirmStrings = { text: "Are you sure you want to remove?", title: "Confirm" };
        var confirmOptions = { height: 200, width: 450 };
        var msg = "";
        var selectedIds = ID;
        var blCanSubmit = true;
        var selectedRows = primaryCtrl.getGrid().getSelectedRows();
        console.log("choose" + selectedRows.getLength() + " records.");
        if (selectedRows.getLength() === 0) {
            msg = "Please select at least one item!";
            blCanSubmit = false;
        }
        if (blCanSubmit) {
            Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
                function (success) {
                    if (success.confirmed) {
                        Xrm.Utility.alertDialog("Removing data, please wait...");  // useful
                        Xrm.Utility.showProgressIndicator("Removing data, please wait...");//not work
     
                        selectedRows.forEach(function (row, i) {
                            var entityId = row.getData().entity.getId().replace('{', '').replace('}', '');
                            var entity = {};
                            entity.statecode = 1;
     
                            Xrm.WebApi.online.updateRecord("crb94_xxxxxx", entityId, entity).then(
                                function success(result) {
                                    var updatedId = result.id;
                                    console.log(updatedId);
     
                                    parent.window.location.reload();
                                },
                                function (error) {
                                    Xrm.Utility.alertDialog(error.message);
                                }
                            );
                        });
     
                        Xrm.Utility.closeProgressIndicator();
                    }
                }
            );
        }
        else {
            Xrm.Utility.alertDialog(msg);
        }
    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans