April 19, 2024

SamTech 365

PowerPlatform, Power Apps, Power Automate, PVA, SharePoint, C#, .Net, SQL, Azure News, Tips ….etc

Issues with attachments, SharePoint 2007 custom display list

It is a known issue that the attachment feature in custom form web part cannot be used. Currently, there are two workarounds for you:

 

Workaround 1

 

Note: You can use this workaround if attachment functionality is required for New or Edit custom list forms.

Use normal List Forms instead of Custom List Forms.

Workaround 2

 

Note: You can use this workaround if attachment functionality is required for Display custom list form.

  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 webpart.
  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.

It is a known issue that the attachment feature in custom form web part cannot be used. Currently, there are two workarounds for you:

 

Workaround 1

 

Note: You can use this workaround if attachment functionality is required for New or Edit custom list forms.

Use normal List Forms instead of Custom List Forms.

Workaround 2

 

Note: You can use this workaround if attachment functionality is required for Display custom list form.

  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 webpart.
  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.