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 "