Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

How to cancel service activity on button click event and making same time slot available for next booking using javascript in MS Dynamics CRM 2016?

$
0
0

I have written script for cancellation of service activity on button click event like this

function CancelServiceActivities(ids,control)
{
    var confirmation = confirm("Are you to cancel the selected appointment(s) ?");
    if (confirmation == true)
    {
        var comments = prompt("Please enter valid reason");
        if (comments == "" || comments == null)
        {
            alert("Invalid reason entered. Please click on Cancel appointment and enter valid reason.");
            return;
        }

        for (var i = 0; i < ids.length; i++) {
            var id = ids[i].replace("{", "").replace("}", "");
            UpdateServiceRemarks(id, comments);
        }
        control.refresh();
    }
}

 

but with this script activity got cancelled in status but when I tried to book another activity for same slot it give me error like" this slot is already booked for some other activity "

 


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>