I have a problem updating lists from my Office-365 sharepoint hosted app. My SPServices call can update a list inside my site, but when I webURL back (prune the path) to the site collection, I can read lists but cannot update them. I have permissions set to full control for sitecollections and I know the SPService code works when webURL is removed and I point to local lists (not at the site collection level).
When attempting to update records the response is "success" but internal soap has all the records unmodified and the error message is ErrorCode = 0x81020077 and ErrorText = "Could not access server"
Gotta be some permission issue I'm not understanding.
The code below works when I am updating lists from my app in my little "bubble" that gets created when my sharepoint hosted app is deployed in 365. When I turn on sitecollection permission I can then access lists outside my bubble and view all lists. But I can't update them with the same code (I simply add a webURL and change the listname).
$().SPServices({
operation: "UpdateListItems",
webURL: "/sites/steve/", // The list we want is here...
listName: "foo", // generic list.
updates: "<Batch OnError='Continue' PreCalc='TRUE'>" +
"<Method ID='1' Cmd='New'>" +
"<Field Name='Title'>Hello World</Field>" +
"</Method>" +
"</Batch>",
completefunc: function (xData, Status) {
// Handle Network exception...
if (Status.toLowerCase() == "error")
throw CXX.CreateExceptionCNetError(xData.responseText, xData.status, xData.statusText);
// so far so good, now we examine the soap data...
}
});
Is this a rule for hosted apps (javascript only) that modifications to sitecollection lists is not supported?
Thanks!!!