Greetings,
I'm trying to put a select dropdown on a SharePoint page to action a task. I want to use the Rest.svc since I don't have access to any server side code. Initially, I'm trying to get the list of actions to populate the select, but I'm getting "Access Denied" errors which I believe are stemming from the cross domain nature of this activity (SharePoint to the K2 server...)
Here's my function. What am I doing wrong? I've been trying to follow instructions from the following sites. http://www.k2underground.com/blogs/k2/archive/2012/05/10/integrating-k2-client-events-with-dynamics-crm-2011-using-k2-services.aspx and http://help.k2.com/en/k2u.aspx?DefaultFilters=%26Filter_Product%3D0010%26Filter_Channel%3D0100 and http://cyclops.nettrends.nl/blog/2011/04/k2-and-jquery-creating-a-simple-worklist/#more-342
function getActions(sn){
var K2URL = K2Server + "/K2Services/REST.svc/Worklist/Items(" + sn + "/Actions?$format=json'";
$.support.cors = true;
$.ajax({
url:K2URL,
method: 'GET',
contentType: "application/json; charset=utf-8",
dataType: 'JSON',
async: true,
headers: {"X-Requested-With": "XMLHttpRequest"},
crossDomain: true,
error: function (data, error, status) {
alert(status);
alert(JSON.stringify(data));
},
success: function (data) {
PopulateWorkflowDropDown(data);
}
});
}