Deleting a form from sharepoint - InfoPath Dev
in

InfoPath Dev

Deleting a form from sharepoint

Last post 08-09-2007 03:12 AM by Shiva. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-01-2007 01:08 PM

    Deleting a form from sharepoint

    Hi,

    can anyone tell me how to delete a from from sharepoint library?

    I have searched through the site and I found post from Agni Reddy (

    http://www.infopathdev.com/blogs/agni/archive/2006/03/12/Delete-File-from-SharePoint.aspx

    ), but I was not able to get it to work.

     On Agni's post, I wasn't able to get the following part to work.  Can anyone have an easier way to delete a form or does anyone know how to get this to work?

    Add code to call the SharePointDelete data connection:

    1. Open the following code into the FormCode.cs:

    private void deleteFile(string fileName)
    {         
        thisXDocument.GetDOM("UpdateListItemsConfig").selectSingleNode("/UpdateListItemsConfig/SharepointDelete/Batch/Method/Field[@Name = 'FileRef']").text = fileName; 
        WebServiceAdapter2 deleteFileFromSharepoint = (WebServiceAdapter2)thisXDocument.DataAdapters["SharePointDelete"];
        deleteFileFromSharepoint.Submit();   
    }

    1. Pass the complete filepath to the Method for deleting the File
      Ex: http://serverName/sites/SharePointDelete/TestDelete.xml

     

    Any help would be appreciated.

     

    Thanks

  • 08-09-2007 03:12 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Deleting a form from sharepoint

    Hi,

     

    You have to pass the complete url of which you want to delete the xml. In that above How To is about delete one xml file from SharePoint. What type of error you are getting?

     

    First line of the code is tells that setting the file name to web service connection. And second line is creating the share point data adapter. After that deleting the above selected xml using submit method in web service.

     

    Hope this helps you

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.