show progress when click button Dynamics CRM 365


Staff member
I have a ribbon button to execute custom workflow. this action a setup from JavaScript and it worked perfectly. In this case I wanna show progress loading when after click or during custom workflow execution.

I just followed the tutorial <strong><a href="" rel="nofollow noreferrer">HERE</a></strong>. this my javascript function code:

function showLoadingMessage() {
    try{ = 'none';
        var newdiv = document.createElement('div');
        newdiv.setAttribute('id', "msgDiv");
        newdiv.valign = "middle";
        newdiv.align = "center";
        var divInnerHTML = "&lt;table height='100%' width='100%' style='cursor:wait'&gt;";
        divInnerHTML += "&lt;tr&gt;";
        divInnerHTML += "&lt;td valign='middle' align='center'&gt;";
        divInnerHTML += "&lt;img alt='' src='/_imgs/AdvFind/progress.gif'/&gt;";
        divInnerHTML += "&lt;div/&gt;&lt;b&gt;Working…&lt;/b&gt;";
        divInnerHTML += "&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";
        newdiv.innerHTML = divInnerHTML; = '#FFFFFF'; = "15px"; = "1010"; = document.body.clientWidth; = document.body.clientHeight; = 'absolute';
        document.body.insertBefore(newdiv, document.body.firstChild); = 'visible';

and this one is to hide progress:

function hideLoadingMessage(){ = 'hidden';

this is the function that I called in my ribbon button action for testing loading progress work or not:

function ribbonButton()
    var guid =;
    if (guid != null)
        showLoadingMessage(); //show progress

        /*var workflowId = '04E84379-87E4-E711-814E-000C294D2FF8';
        var workflowName = 'CloneReward';
        ExecuteWorkflow(workflowId, workflowName, function ()

        //hideLoadingMessage(); //hide progress

when I pressed the button I get the following error message:

<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>

Need any suggestions. Thanks.