Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WebserviceCall = function () {
{
var enable = true;
var listId = SP.ListOperation.Selection.getSelectedList();
var items = SP.ListOperation.Selection.getSelectedItems();
if (items.length == 0)
return false;
var selectedIds = new Array();
for (var i in items) {
selectedIds.push(parseInt(items[i].id));
}
//The list id is a GUID string like, i.e. "{77c51b5a-fb48-4228-8c92-ee5834d7fefc}"
var data = { selectedIds: selectedIds, listId: listId };
jQuery.ajax({
url: "/sites/docs/_vti_bin/RibbonMethods.asmx/IsAnyDocumentScheduled",
type: "POST",
dataType: "json",
data: JSON.stringify(data), async: false,
success: function (result, status) {
enable = result.d;
},
error: function (jqXHR, textStatus, errorThrown) {
MS.InformationManagement.Common.ShowStatus(jqXHR.responseText, 'red', 6000);
enable = false;
},
contentType: "application/json; charset=\"utf-8\""
});
return enable;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment