Fix for the Custom Form Attachments Issue

In my first blog post called Displaying SharePoint Fields by Permission level, I made a side note that said

Also, I’d like to note that when using custom forms like this, the Attachment button doesn’t work anymore.  I think there are blogs somewhere about this bug, but I’ve never tried fixing it.

Well, Microsoft finally has a fix for this.  So, apparently, as long as you do have the infrastructure update installed on your servers, and your SharePoint Designer is at SP1 level, you can install the following fix:

The following is the email directly from Microsoft about where to get the fix, and how to apply it:
__________________________________________

This is the client side fix:

http://support.microsoft.com/kb/960311

The server side fix you already have installed but that is the WSS 3.0 Infrastructure Update.

Download this and update your SPD. This will place the code needed to make attachment functionality work for new and edit forms.

For Display forms only, you need to add this:

  1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.
  2. Expand out Lists -> [List Name] -> open DispForm.aspx .
  3. Highlight normal list form by clicking on it. This will select the entire web part.
  4. Right-click on selected web part, and choose Web Part Properties…
  5. Expand [+] Layout, check option for Hidden, click OK.
  6. With web part still highlighted, hit the right-arrow key once. Hit Enter. This creates some whitespace to insert.
  7. Go to File | Insert SharePoint Controls | Custom List Form…
  8. Select appropriate list or library, content type, and type of form to create. Click OK.
  9. Put cursor in the “Expires” table cell, right-click | Insert | Row below. There should now be a new table row with two column cells.
  10. Put cursor in the left table cell of the new row, type “Attachments”.
  11. Put cursor in the right table cell of the new row, go to Code view, and paste the following code:
    <SharePoint:AttachmentsField ControlMode=”Display” FieldName=”Attachments” runat=”server” Visible=”true”/>
  12. Save page.

In summary, in SharePoint Designer, when you insert a custom form (DVWP) to create your own custom EditForm.aspx, DispForm.aspx, and NewForm.aspx, the attachment functionality won’t break anymore.

Technorati Tags:

15 comments

  • Laura, I have really enjoyed your postings! Keep up the good work. You are hitting on a lot of the nuanced power of SharePoint and blog in a very direct style that is easy and enjoyable to read. Lee

    Like

  • Thanks a lot for this – very helpful. For some reason, when I select Web Part Properties instead of showing the properties it shows a preview of the dispform.aspx page in a narrow window (the size of the window the properties should be in). This is strange behavior and I have no explanation for it. It might be unique to our environment. The work around I found is to go to the code and look for tag. Change its value to false and it will hide the web part.

    Like

  • Laura – this is exactly what I need, but when I try to apply the Hotfix for Office (KB960311) I get a dialog popup that reads “The expected version of the product was not found on the system.” I have checked and I do have SPD installed with SP1 applied. I have also stepped through your process and attachments are not displaying so I am assuming that this hotfix somehow needs to get applied, but I am running into a brick wall. Any insights as to what the problem could be? Thanks!

    Like

  • Great post, thanks very much. Having the same problem as Jill, “The expected version of the product was not found on the system.” SPD SP2.

    Like

  • Hi, Great Post! Could you plz suggest as to how to rectify this issue in Newform.aspx and Editform.aspx

    Like

  • Shubham, The same method works for all forms, from what I rememeber, but if you simply install the latest SharePoint 2007 service pack on both your server and SPD service pack on your client machine, this bug is fixed.

    Like

  • You, my friend, are a God send. Thank you!

    Like

  • Is there a fix that does not require SPD? I have created a form in InfoPath 2010 and published it to SP 2010. I have a drop down that unhides different sections depending on the selection. If the user tries to attach a file before selecting something in the drop down, the attachment control works. But if they select an item from the drop down, the attachment control stops working. I am not sure why the hiding/unhiding of other sections affects the attachment control. Any thoughts? The attachment selection is not in any of the sections that are hidden.

    Like

  • Marie,
    This was a bug way back in SharePoint 2007, and Microsoft fixed it with a service pack.

    Like

  • Hi Laura,

    Many thanks for this article . I have two questions:

    1. Can I Create a custom list, include the attachment option and add a workflow (through sharepoint designer) to that list ? is there any issue if a user needs to view the attachment (through links , e.g editifs.aspx? or newifs.aspx?)

    2. Is there any possibility to automate creation of views . For example , I have a list (containing +- 10,000 items) and I need to create + 50 views in each quarter – is there any possibility to automate the creation of Views to avoid create +50 views during each quarter (and setting permissions..)

    Thanks a lot and stay safe,

    Yvan

    Like

    • There are ways to do all the things you mentioned, but those are all done in SharePoint online, with Power Apps and Power Automate, and even PowerShell. Sorry Yvan, but I wrote that blog post *eleven* years ago, and that technology is very, very old now.

      Like

  • Hi Laura,
    I have an issue with an InfoPath2010 form where an attachment control shows an ever running hourglass when the control is clicked in an Office 2013 environment. When I open this form in design mode in the Office 2013 / Windows 10 environment, an ever running hourglass shows from the moment the form is opened.
    Any idea? I have no clue. where to search

    Like

    • I haven’t used InfoPath in years. It’s very old and I wouldn’t expect that it would still be compatible with your OS / browsers nowadays.

      Like

    • That’s a pity, because we have several InfoPath-Filler forms that are still in use. Our company never moved fast to next generation software and OS’s.
      We already know that InfoPath does only run with IE. All the forms tested with our ‘new’ Citrix environment with Windows 10 and Office/InfoPath 2013 seem to do fine, except this very (most important) form. When opened in designmode the form seems to hang immediately. When I do the same at my private laptop, it opens just fine.

      Have any idea in what direction to search for such an issue? I hoped for your help, because you’ve always been the guru!
      Maybe you know someone who knows a lot of InfoPath that is still using it?

      Like

    • Nope, and you should hurry to figure out a new solution other than InfoPath. 😉

      Like

Leave a Reply to LisaJo Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.