Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Progress Indicator bar stopped working

(0) ShareShare
ReportReport
Posted on by 235

Hello CS Experts,

I have placed a custom button on contact form. This button sets a value to a field date. The code include a call to Progress Indicator API. It was working before then for an unknown reason it just stopped functioning.

All other parts of the code are working perfectly except the progress indicator.

Below is my javascript code:

//function to set GDPR Deletion date
function setDeletionDate(executionContext){
    var formContext = executionContext;
    var notificationTime=3000;
   
    if (formContext.ui.getFormType() == 2)
    {    
       
        var prevDate = formContext.getAttribute("ava_gdprdeletiondate").getValue();
        var confirmStrings = {title: "Confirm GDPR Revocation" , text: "Are you sure to revoke GDPR                                                  Consent?"}
        var confirmOptions = {width: 450, height: 200};
        Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
            function (success) {
              if (success.confirmed) {
               
                var delDate = new Date();
                formContext.getAttribute("ava_gdprdeletiondate").setValue(delDate);
                formContext.data.refresh(save).then(successCallback, errorCallback);
                
                Xrm.Utility.showProgressIndicator("Revoking GDPR consent....");
     
                setTimeout(
                function () {
                Xrm.Utility.closeProgressIndicator();
                },
                notificationTime
            );
               
                         
              } else {
                formContext.getAttribute("ava_gdprdeletiondate").setValue(prevDate);
            }
            });
       

       

    }
   
}
Can somebody from the community help me point out where the code is not working. I already used Javascript validator from XRMtoolbox and it did not show any error.
Regards,
Jolas365
  • Jolas365 Profile Picture
    235 on at
    RE: Progress Indicator bar stopped working

    Hello Steve Zhao2 ,

    Thank you very much!

    Regards,

    Jorge

  • Verified answer
    Steve Zhao2 Profile Picture
    on at
    RE: Progress Indicator bar stopped working

    Hi Jolas365,

    The parameter save should be a Boolean value in this line formContext.data.refresh(save).then(successCallback, errorCallback);

    So please declare the save variable before.

    function setDeletionDate(executionContext){
        var formContext = executionContext;
        var notificationTime=3000;
        var save = true;
       
        if (formContext.ui.getFormType() == 2)
        {    
           
            var prevDate = formContext.getAttribute("ava_gdprdeletiondate").getValue();
            var confirmStrings = {title: "Confirm GDPR Revocation" , text: "Are you sure to revoke GDPR                                                  Consent?"}
            var confirmOptions = {width: 450, height: 200};
            Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
                function (success) {
                  if (success.confirmed) {
                   
                    var delDate = new Date();
                    formContext.getAttribute("ava_gdprdeletiondate").setValue(delDate);
                    formContext.data.refresh(save);
                    
                    Xrm.Utility.showProgressIndicator("Revoking GDPR consent....");
         
                    setTimeout(
                    function () {
                    Xrm.Utility.closeProgressIndicator();
                    },
                    notificationTime
                );
                   
                             
                  } else {
                    formContext.getAttribute("ava_gdprdeletiondate").setValue(prevDate);
                }
                });
        }
    }

    Reference:

    data.refresh (Client API reference) in model-driven apps - Power Apps | Microsoft Learn

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,277 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,019 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans