Using SPService to delete items in a separate site collection

Feb 21, 2013 at 6:23 AM
Edited Feb 21, 2013 at 6:24 AM
Hi Marc,
I wanted to know if it is possible to delete items on a list sitting on a separate site collection to where you are running the script from.
Forget about why I want this done. I have been successful in using the "CopyIntoItemsLocal" to copy a document from a site collection into another. And now I want a mechanism to delete it.
By, the way I am using Office 365 for sharepoint 2010.
Just to try out the code, I have tried the webURL within "GetList" to see if I can connect and get a response, but I do not get back any response. See code below:
$().SPServices({
        operation: "GetList",
        async: false,
        webURL: "http://testcloud-web.sharepoint.com",
        listName: "List1",
        completefunc: function(xData, Status) {
                        alert("Status=" + Status + " XML=" + xData.responseXML.xml);
        }
    });
Feb 21, 2013 at 7:08 PM
I was unable to do cross-site collection activity until I added the following line at the top of my code....
$.support.cors = true;
Once I did that, my calls ran successfully. I have not tried a delete action, though.

GKO
Feb 21, 2013 at 9:33 PM
By putting
$.support.cors = true
all I get is Status as error. Remember that both my site collections are in the same Office 365 tenant. Has anyone done this before?
Coordinator
Feb 22, 2013 at 3:56 PM
Have you looked at the Web traffic to see what the error is?

M.