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

Announcements

No record found.

News and Announcements icon
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
    Microsoft Employee 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
FSRon Profile Picture

FSRon 59

#2
James White Profile Picture

James White 21

#3
AT-28040446-0 Profile Picture

AT-28040446-0 20

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans