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 :
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
I have the same question (0)
  • Verified answer
    Steve Zhao2 Profile Picture
    on at

    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

  • Jolas365 Profile Picture
    235 on at

    Hello Steve Zhao2 ,

    Thank you very much!

    Regards,

    Jorge

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 61 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 31 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans