Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: SPServices CopyIntoItemsLocal

$
0
0
hey all,

We're slowly replacing some of our more basic InfoPath forms with custom HTML forms to deploy single-page applications more easily. But, I have a requirement to maintain the connection to the original document library containing the the existing Infopath Documents/Items whatever you want to call them.

I've managed to create the form just fine and I can pull data from the original list just fine. What I can't do is push new items into the list. I can get the name of the template for the list using GetList and then finding the DocTemplateUrl attribute on the List element, which gives me my Source Url (with http:// appended). I create a DestinationUrl based on the title of the new document and generate it this way:
$().SPServices({
     operation: 'CopyIntoItemsLocal',
     async: false,
     SourceUrl: ('http://' + retrievedTemplateUrl),
     DestinationUrls: [('http://Site/Library/' + documentName + '.xml')],
     completefunc: function(xData, Status){
          if($(xData.responseXml).SPFilterNode('CopyResult').attr('ErrorCode') != 'Success'){
               errorHandling(xData.responseText); 
          } else {
               //do some stuff
         }
     }
});
The problem is that the Result of the operation is empty. It comes back with a CopyLocalResult of "0", presumably meaning no syntactical or schematic errors are present, but it doesn't actually copy anything.

Can this not be done within one list? Meaning, I can't copy the template.xsn to a new xml within the same library? Do the libraries have to be different? Or am I missing something else?

Viewing all articles
Browse latest Browse all 6517

Trending Articles