Update InfoPath xml to delete attachments in repeating section - InfoPath Dev
in

InfoPath Dev

Update InfoPath xml to delete attachments in repeating section

Last post 10-15-2015 10:56 AM by hydcoolguy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-14-2015 12:44 PM

    Update InfoPath xml to delete attachments in repeating section

     Hello everyone,

    I have a form library with already existing items. I would like to delete all the attachments inside the repeating section of the form programmatically using C#. I am at a stage where I can delete the attachments but when the form is saved back to the library, I get the error when I try to open the form "the processing instruction in the file is missing or invalid" Seems like it is missing the first few lines. Any help is appreciated.

    Also just wanted to mention, the program is a  Window Application that loops through all the items in the form library and NOT the InfoPath code withing the form.

    Thanks!

    Sr. SharePoint Developer
  • 10-15-2015 06:14 AM In reply to

    Re: Update InfoPath xml to delete attachments in repeating section

    Please let me know if anybody tried to this. Thanks!

    Sr. SharePoint Developer
  • 10-15-2015 10:56 AM In reply to

    Re: Update InfoPath xml to delete attachments in repeating section

     I found out that I can get the Processing Information using the below line of code and add it to the beginning:

     

    var ProIns = ipFormNav.SelectSingleNode("//processing-instruction('mso-infoPathSolution')", NamespaceManager);

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