This project has moved and is read-only. For the latest updates, please go here.

Using SPService to delete items in a separate site collection

Feb 21, 2013 at 7:23 AM
Edited Feb 21, 2013 at 7: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:
        operation: "GetList",
        async: false,
        webURL: "",
        listName: "List1",
        completefunc: function(xData, Status) {
                        alert("Status=" + Status + " XML=" + xData.responseXML.xml);
Feb 21, 2013 at 8: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.

Feb 21, 2013 at 10: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?
Feb 22, 2013 at 4:56 PM
Have you looked at the Web traffic to see what the error is?