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