3/06/2013

Displaying attachment link in a SharePoint custom list form – "DispForm.aspx"

Displaying attachment link in a SharePoint custom list form – "DispForm.aspx"

Recently while working with SharePoint lists I required to customize the out-of-the-box list item display form “DispForm.aspx” to present a design-frenzy item view format.

During the modification process, I never assumed that the list item attachments would abruptly dissapear from the display form. All I was looking to do was to display the list item in a good looking format by modifying the XSLT, but the attachments were gone!

Lesson Learnt: Never modify the out-of-the-box list item display form “DispForm.aspx”. Create a new one if you need to and call it “DispForm_WhateverYouCallIt.aspx”

Now the attachments that were gone seemed quite easy to be brought back on the page. It needed a SharePoint control AttachmentsField that went missing from the picture. Below is the code that you need to add into the XSLT template dvt_1.rowview (into your custom form) that constructs theDataFormWebPart that SharePoint Designer creates for you when you insert a Custom List Form:

Infopath cannot save the following form: http://servername..... This document library was either renamed or deleted, or network problem are preventing the file from being saved. If this problem persists, contact your administrator.

Infopath cannot save the following form: http://servername.....  This document library was either  renamed or deleted, or network problem are preventing the file from being saved. If this problem persists, contact your administrator.


This error started appearing every time I try to publish a particular template back to the library.  I've been working with this template all week without any issues until this.  The document library wasn't renamed or deleted.  I can edit and publish changes to form library templates in other site collections without a problem.  This particular form library template does not contain any custom code.
Now in this case, there are couple of things you should try as suggested by Carl G - DC
  • Go to another PC and log-in into windows with your account, then open the template from the library and publish back to the library
  • Open IP Designer on your machine, open an old version of the form, and choose File | Publish | SharePoint Server and choose the same library
  • Clear the InfoPath cache (Start | Run | InfoPath /cache clearall)
  • From IP Designer, File | Publish | SharePoint Server, but this time enter full URL of file path (including the template.xsn)
  • Navigated to Library Settings | Re-link documents to this library, then selected the only submitted document and clicked Re-link All.  Then edit the template and try to publish back to the library
  • Open IP Designer on your machine, open an old version of the form, and choose File | Publish | SharePoint Server and choose to publish to a new library.  Then edit the template in that new library and published again
  • Also try cranking up monitoring for InfoPath Forms Services in Central Admin, repeat the same test of editing and publishing the template and then check the Windows Events Logs on all SharePoint servers in the farm.