Deleting Attachment from Infopath and Sharepoint List. - InfoPath Dev
in

InfoPath Dev

Deleting Attachment from Infopath and Sharepoint List.

Last post 05-02-2013 03:14 AM by Ravik. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-01-2013 03:36 AM

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Deleting Attachment from Infopath and Sharepoint List.

    Hi there, Can anyone please guide me how to delete an attachment from infopath by using delete button at the same time the attachment should be deleted from the sharepoint list too. how to get this done using C#. Im fairly new to C#. Any help would be greatly appreciated Many Thanks.
  • 05-01-2013 07:21 AM In reply to

    Re: Deleting Attachment from Infopath and Sharepoint List.

     Hi - to delete an attachment in an InfoPath form, you shouldn't need code - your button can just set the attachment field to blank. As to deleting the same file from a SharePoint list - what information do you have about the list item in the form? Do you know the ID, or the URL of the attachment? I use the DeleteAttachment Lists web service method to do this without code, but it requires knowing the URL of the attachment and the list item ID.

    Hilary Stoupa

  • 05-01-2013 07:50 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Re: Deleting Attachment from Infopath and Sharepoint List.

    Hi Hilary, Thanks for getting back to me. Basically all i wanted is as soon the user triggers the delete button the attachment field should become clear and at the same time the uploaded attachment should be deleted off from the SharePoint list . I do have the ID and URL of the attachment.
  • 05-01-2013 08:19 AM In reply to

    Re: Deleting Attachment from Infopath and Sharepoint List.

     So - is this a List form? Or do you have some custom code or functionality writing to another list?

    Hilary Stoupa

  • 05-02-2013 03:14 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Re: Deleting Attachment from Infopath and Sharepoint List.

    Hi Hilary, Sorry for the late reply. Managed to get it working now using your method. Many thanks Can you please help me with the following issue please. what im trying to do here is copy a repeating table using InsertAfter method. The problem im having is every time i click on the copy button, a new repeating appear on the top than in the bottom, it pushes the existing one down and the new one takes it place on the top.. how to i get them in sequence? please see the attached code for reference. Thanks for you patience.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.